In visual studio 2008 Professional, when I create a unit test for a method (using the native vs studio framework and wizard), the generated test file stub is saved in the root directory of the test project.
When I later move the test file to a sub-directory, I cannot use the wizard to create more test stubs for other methods of the same class ( it will create a new empty file in the root and then silently fail )
How can I change this so the test project uses the same folder structure as my main project; so if a class is e.g. in project-root\model\xyz.cs
, the corresponding test class is automatically generated in testproject-root\model\xyzTest.cs
?
edit:
Add the moment, this seems to be an unsolved bug with visual studio. Besides the workaround described in the answer below, another possibility is to simply rename the autogenerated test classes after moving the respective test class files. Then Visual Studio will at least not silently fail but recreate the old test class file in the root folder when generating another test method, and that test method can then be copy-pasted into the correct file