C# Test Frameworks Comparisons


There are number of unit testing frameworks available to .NET programmers, these include:

  1. MStest
  2. NUnit
  3. xUnit
  4. MBunit

They are all offer support for providing a framework for creating tests and executing them. Each one has strengths and weaknesses. The main requirements are:

  1. Must integrate with Visual Studio.
  2. Supported by Resharper and NCrunch.
  3. Must be able to be executed by the continuous integration tool, Jenkins. Possibly others in the future such as Team City or Visual Studio Online.

Ideally it should also be

  1. Easy to learn
  2. Fast
  3. Rich set of assertions
  4. Support data driven tests

Although MSTest is the obvious choice as it comes in the box with Visual Studio, NUnit is one of the more mature products and has the most 3rd party support. xUnit looks to be the newest kid on the block and appears to be written by the some of the people who wrote NUnit (http://xunit.github.io/docs/why-did-we-build-xunit-1.0.html). It has the latest thinking and makes use of newer .NET features that were not around when NUnit was first written. However xUnit’s documentation doesn’t seem as extensive as NUnit’s.

Conclusion

Staying with MSTest means that no changes are required to the current odd unit tests. Moving to NUnit will require some rework and updates to the scripts that Jenkins uses for running the tests and reporting the results, but would allow to exploit the enhanced features of NUnit.

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
384 words
Last Post: Trends of the Internet Websites
Next Post: C# Test Mocking Frameworks

The Permanent URL is: C# Test Frameworks Comparisons

Leave a Reply