Visual Studio 2013 MSTest vs NUnit
MSTest Vs NUnit:
- MSTest is integrated with VS so it'll be easy to use. NUnit will require third-party tools (some are free, some are paid).
- VS will give you Code Coverage in MSTest. NUnit requires DotCover (which is a paid tool).
- MSTest has an option to execute your tests in parallel if they don't depend on each other. This isn't a feature that NUnit provides.
- NUNit has
TestCaseSourceAttribute
which helps you to achieve parametrized test cases but in MSTest you'll needDataSourceAttribute
which would be in XML file and will be difficult to manage when you have complex logic in the method. - NUnit is faster as compared to MSTest.
Overall both frameworks are good to use, but I'd suggest going for NUnit.
MSTest hasn't changed much since it was originally introduced, so those old comparison posts are still valid. Microsoft's focus on ALM is mostly targeted at further tooling and server products, but the fundamental testing framework hasn't changed much.
It's also worth noticing that MSTest and their entire ALM strategy is targeted at many different styles of automated testing, including Integration Testing, System Testing, Performance Testing, etc., so while it attempts to be a one-size-fits-all, it's quite ill-suited for unit testing, because it's too heavy to work with.
While NUnit is better, I wouldn't recommend it either. It, too, hasn't changed much for years, and the extensibility model is frankly a mess.
Instead, I'd recommend xUnit.net. Although it's not perfect either, it's currently the best mainstream alternative on .NET. There are many reasons why xUnit.net is better than MSTest.