How should we name tests in Visual Studio 2010? We want all tests to be associated with the project that they are testing, but also want all tests to have a common naming format to differentiate them from the source code projects.
-
possible duplicate of [Unit test naming best practices?](http://stackoverflow.com/questions/155436/unit-test-naming-best-practices) – Judah Gabriel Himango Mar 08 '11 at 22:09
2 Answers
I mean you probably just want to keep all your tests in a seperate visual studio project and name it .Tests.
So all the test classes will have namespace .Tests

- 1,850
- 15
- 17
I find it useful to highlight the guidelines and derive the conventions from them:
- Separate product code and tests code into two separate trees
- Make it extremely easy to find testing code for any production code (e.g. be able to run all tests which test some code)
- Separate different kind of tests fixtures (unit, system, stress, etc.)
Based on those guidelines I would:
1. Create the product directory tree without any reference to testing (say Src/product/ns1/ns2
).
2. Create a similar tree for tests, with exactly the same general tree structure (say Test/product/ns1/ns2
)
3. Have a single project for each testing fixture. That is a ProjectUnitTest
contain the unit-tests of project Project
and NamespaceStressTest
contain stress tests for an entire namespace called Namespace
, etc.

- 3,488
- 1
- 29
- 46