Simple approach:
- Choose one of the unit test frameworks (Nunit, MbUnit, Xunit, VS unit test framework, ...)
- Add a unit test project in your solution (e.g. UnitTests).
- Start writing tests.
To simplify the organization, create at least one namespace for each project in the solution, for example UnitTest.Project1, UnitTests.Project2, ... Depending on the size of the projects, add more levels to the namespace.
This test project is part of the solution. If you use some kind of continuous integration tool, then the tests can be automatically executed with every commit in the source code repository.
Edit:
Regarding the comment on the MS unit test. The Framework problem with creating unit tests, there is a problem with the information: βCreate unit testβ wizard does not work . It seems that there are unsupported project types that prevent the unit test wizard from working correctly. I just tried with one solution that has one F # and several C # projects. I added a unit testing project and tried to add tests. The test wizard had problems until I unloaded the F # project. Then everything worked fine.
zendar Feb 24 '09 at 8:55 2009-02-24 08:55
source share