I have been trying to clean up the naming and organisation conventions of our projects' unit and integration tests. We are using C#, NUnit, Visual Studio and Resharper.
It seems that if there is one best practice for unit test organisation it is that the layout and naming of the test classes and namespaces should mirror those of the code under test. As a consequence the file structure will also be replicated.
Wouldn't it be nice to have a tool that could automatically enforce and help refactor code to conform to these conventions? Does a tool like this exist?
For example, it would be simple for Resharper to recognise that OrderTest is a test fixture for the Order class. It could then ensure that the Order class exists and that it is in the same namespace. If the Order class underwent refactoring and was renamed, the OrderTest class should also be renamed.