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 wan开发者_如何学Got all tests to have a common naming format to differentiate them from the source code projects.
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
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.
精彩评论