0

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.

Lisa
  • 1

2 Answers2

0

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

Lav
  • 1,850
  • 15
  • 17
0

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.

Uri Cohen
  • 3,488
  • 1
  • 29
  • 46