Continuing with my adventures in porting java code to .Net, I am dealing with moving JUnit unit tests to .NET. My first move thought was to convert to Microsoft Unit Testing framework. However, after spending quite a bit of time to get it to work, I gave up and switched to NUnit.
Two things that are NOT supported by the Microsoft framework and forced me to switch
- Per-Test StartUp/TearDown functions. [TestInitialize] and [TestCleanup] are not called for every [Test]. They are called when the Test class is initialized. That means its very hard to have a good Initialization and Cleanup routines for every test.
- Lack of Test Inheritance. I a set of unit tests that test different implementations of an interface. The core test of the interface must be the same to make sure that all implementations handle the core identically. However, There might be special additional tests to validate extended functionality. Currently, you can not accomplish that with Inheritance.
Both are fully supported by NUnit.