Choosing of the unit testing framework (xUnit, NUnit, MSTest)

Is xUnit is a modern and future proof solution for unit testing? I’m measuring pros and cons of xUnit and NUnit for the big and old legacy application. At the first go I thrown away MsTest because the more efforts are required to do the same things. Also it is not as extendible as others. The main question is whether xUnit is ready enough to production and future proof tool.

The Findings

On the one hand, NUnit is old and reliable tool with almost all required features. On the other hand, xUnit declares the same features as NUnit, but in more organic manner for developers. For instance, without some useless attributes or uses different names for same things, but in the nutshell they are quite similar. I couldn’t found any essential benefits of xUnit before NUnit, except related to peoples’ mindset. They could be expressed in this way:

There are a lot of resources in the web about that, but there is no any useful enough though. These are the most informative:

Both tools have support of asynchronous tests (xUnit, NUnit). Although I’d like to have ability to configure via attributes a scenario when a single test method could be ran in several threads simultaneously. I didn’t find that for these testing framework.

Both have support in Visual Studio and CI tools by means of plugins.

Wrapping Up

In the end I consider them quite similar. Both frameworks are reliable for the production. I suppose the choice between them should rely on team’s skills. Nevertheless if you’d like to show your team as a modern and innovative choose xUnit.

If you know a scenario when xUnit lose to NUnit, please, let me know.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Post

%d bloggers like this: