Migrating from NUnit to xUnit

added by tdupont
4/8/2012 8:55:05 PM

2 Kicks, 573 Views

If you are currently using NUnit to write your unit tests, then it is not at all difficult to migrate to using xUnit. The philosophical difference between the two is simply this: with xUnit you need to think of your tests as objects, rather than of methods. Here is a visual representation of equivalent test setups between NUnit and xUnit...


4/9/2012 9:45:02 AM
I originally started with xUnit myself, but decided that with the better support that nunit has there was no point. xUnit sort of feels like a "me too" project. To me it feels like they changed keywords and concepts just for the sake of changing them. The words test and fact are not interchangeable, yet they're used to represent the same concept in both frameworks.

4/10/2012 8:43:36 PM
The fact that NUnit is still the predominant unit testing framework for .NET is a true testament to just how well it was designed. It's small and simple, yet very powerful.

That being said I have been really enjoying some of xUnit's newer features, such as the data driven Theories (which will probably be the subject of my next blog post). :)