I'm looking for a good way to organize my unit tests in a .NET project. Right now, I have one TestClass
per application class, with multiple tests for each method. Although I am using TestCategory
to categorize each TestMethod
by the application class method it tests, finding my test methods is becoming ungainly.
I'm considering splitting my test classes into partial classes - one partial class per application class method. This means that I can have multiple TestMethod
in one dedicated file per method, without having to hunt through a large file to find them.
Are there any pitfalls to this approach? Are there better ways of handling large test classes in .NET and Visual Studio?
Edit: I am using IoC (we're using Castle.Windsor for DI outside of the tests) and we're using Moq for mocking capabilities. Tests are initialized with TestInitialize
.