views:

228

answers:

4

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?

+7  A: 

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.

Paddyslacker
@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
Fixed the conclusion to match the title of the blog post. Thanks for keeping me honest, Scott!
Paddyslacker
They're really pretty much the same IMHO.
Jeff Wilcox
@Paddyslacker: You're welcome. :)
Scott Dorman
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.
BryanGrimes
A: 

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.

Matt Briggs
+1  A: 

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.

TrueWill
+1  A: 

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 http://geekswithblogs.net/sdorman/archive/2009/01/31/migrating-from-nunit-to-mstest.aspx for more information. To add some of the missing Assert methods, see http://geekswithblogs.net/sdorman/archive/2009/01/31/adding-custom-assertions-to-mstest.aspx).

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.
Scott Dorman