With the framework that Visual Studio 2008 has, am I missing anything great by NOT using an external tool like NUnit? From what I can tell it seems like using NUnit would be more of a hassle with manually creating test classes and methods versus the right clicking native to the IDE. That being said, am I missing features that NUnit provides that VS doesn't contain? Having a simple GUI for my QA people to access is fine and all, but using nAnt and the build dependencies on unit tests passing, am I missing cool features?
-
The answers to this question may be helpful: http://stackoverflow.com/questions/92869/nunit-vs-visual-studio-2008s-test-projects-for-unit-testing – David Johnstone Mar 11 '10 at 03:57
4 Answers
Roy Osherove just wrote a recent blog post summarizing the differences between NUnit and MSTest. I think it answers your question.
He concludes that NUnit wins for Unit Testing, but MsTest has much better abilities for integration based testing and team testing with Team System.

- 1,880
- 1
- 14
- 20
-
@Paddyslacker: Nowhere in Roy's blog post does he make any statements to the fact that "NUnit is far superior for true unit testing". – Scott Dorman Mar 11 '10 at 03:40
-
Fixed the conclusion to match the title of the blog post. Thanks for keeping me honest, Scott! – Paddyslacker Mar 11 '10 at 03:45
-
-
Thanks, I checked out Roy's post and also found this link back to here. http://stackoverflow.com/questions/1487773/is-there-anything-i-can-do-in-nunit-that-i-cant-do-in-mstest/ Good stuff, now I just need to test drive NUnit in a real app first. Thanks. – bryan Mar 11 '10 at 13:40
I have used both NUnit and MSTest. Yes, there are differences. NUnit is an older, more established unit testing framework designed to do exactly one thing - unit testing. MSTest is newer so it does not have the same level of maturity in its API. For example, NUnit offers more Assert methods than MSTest. (See Link for more information. To add some of the missing Assert methods, see Link).
I have not really found performance to be an issue with either framework.
Some of the bigger differences are:
- MSTest requires a Visual Studio instance on the build server in order to run. It does not contain a standalone test runner like NUnit.
- MSTest provides test results and code coverage results directly within Visual Studio. NUnit provides test results in its own UI and requires additional tools to perform code coverage analysis.

- 21,988
- 13
- 81
- 109

- 42,236
- 12
- 79
- 110
See MSBuild, NAnt, NUnit, MSTest, and frustration. If you're not using TFS as your CI/build server, you may want to seriously consider NUnit or one of the other open source projects.

- 25,132
- 10
- 101
- 150
I use MSTest at work because I have to, and to be honest, I find it slow and irritating. If I had my choice, it would be xunit.net (basically like nunit, just a bit less verbose) + the resharper test runner for IDE integration.

- 41,224
- 16
- 95
- 126