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?
views:
228answers:
4Roy 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.
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.
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.
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.