Since Microsoft created MSTest, I've been using it for unit testing. I never really used NUnit, and I just didn't like the need to have yet another tool installed on my dev box. I've only used the basic features of MSTest so far, and they have satisfied my needs, and I don't really know anything about NUnit.
Could someone list out some of the disadvantages and advantages of using MSTest and NUnit compared to each other?
MsTest is a native unit testing library that comes with Visual Studio from Microsoft. NUnit is an extra Nuget package that needs to be installed on top and interact with the APIs of Visual Studio. Nunit likely doesn't have direct integration into the native APIs like MsTest does.
NUnit will run all the tests using the same class instance, while xUnit will create a new instance for each test.
NUnit was Initially ported from JUnit. Tests can be run from a console runner, within Visual Studio through a Test Adapter or through 3rd party runners. Tests can be run in parallel and has Strong support for data driven tests. Unit supports multiple platforms including .
JUnit is a very popular Unit testing framework for Java and NUnit, which is ported from JUnit and has become a popular Unit testing framework in the . Net world.
For .net core:
NUnit was not fully compatible with .NET Core 2 at the time
https://dev.to/hatsrumandcode/net-core-2-why-xunit-and-not-nunit-or-mstest--aei
Some new features in xUnit:
https://dev.to/franndotexe/mstest-v2---new-old-kid-on-the-block
Here is a nice blog which lists out some differences between MSTest and NUnit http://blogs.msdn.com/nnaderi/archive/2007/02/01/mstest-vs-nunit-frameworks.aspx
And this link here compares even more unit testing frameworks http://www.codeplex.com/xunit/Wiki/View.aspx?title=Comparisons
cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With