I've been using NUnit for a few years. I've tried MBUnit for a short while as well as Zenebug and XUnit but I keep coming back to NUnit.
What is your favorite/most used Unit test Framework? Can you explain why you're using it?
I've been using NUnit for a few years. I've tried MBUnit for a short while as well as Zenebug and XUnit but I keep coming back to NUnit.
What is your favorite/most used Unit test Framework? Can you explain why you're using it?
xUnit.net, but I'm hardly unbiased. :)
Why I use it: http://www.codeplex.com/xunit/Wiki/View.aspx?title=WhyDidWeBuildXunit
I like the way it handles reports, and I'm looking forward to some of the upcoming features I've heard about, such as integration with JsUnit.
I've used nUnit for years, but when we moved to VS2008 and TFS 2008 (using TeamBuild) we decided to try MSTest. No huge complaints there... we really like how well it integrates with the IDE as well as the CI build server.
One new thing we're trying which looks to have awesome potential is another add-on from Microsoft Research called Pex (requires VS2008). As they put it: "Pex generates unit tests from hand-written parameterized unit tests through automated exploratory testing based on dynamic symbolic execution." The way I put it is: this thing does static analysis on your unit test and target code and codegen's unit tests to achieve super high code coverage (which is often impractical if you're doing it by hand).
Gallio looks like it's going to be awesome once it gets more stable (currently alpha).
It's not just a test framework, but a test automation platform, so it will work with many existing test frameworks (MbUnit, NUnit, xUnit.net) yet be fully extensible, with a number of built-in additional features such as report generation in many formats and code analysis tools.
I've also heard that it will be able to
Edit: It is indeed out of alpha now. We've tried it at our company and we really hated it. It was horrible to use and very slow. What a shame.
I've used Nunit for quite some time, but I happen to prefer things baked into VS. So, I'm now using MSUnit. Just a preference for having less add-ins installed in VS.
MSTest
http://en.wikipedia.org/wiki/MSTest
I don't know if it's my favorite (haven't really tried many others), but it's convenient since it's built into Visual Studio.
I like xUnit because of the way it uses the constructor and Dispose methods instead of having to apply attributes to other methods for initialization and all that.
The support for NUnit tests in Resharper is great and sets the bar very high for me moving away from NUnit. I can run all the tests in a solution directly from Visual Studio, or I can drill down and concentrate on specific tests. When my code is checked in, my continuous integration build runs the same tests. This gives me a lot of confidence in my development process.
I used to use NUnit, but now I prefer the framework that comes with Visual Studio 2008, simply because it has tighter integration and is easier to set up to test private methods.
We also had problems with keeping the versions of NUnit synchronized with the rest of the team. It was a minor annoyance (go and upgrade, or fix the project references), but it went away with the switch.
I've been using NUnit for some 4 years now, would definitely recommend using it. Reshaper - a plugin for VisualStudio by JetBrains includes a UnitTestRunner which integrates nicely with VisualStudio and lets you run / debug your tests from directly from the IDE. Resharper, NUnit and RhinoMocks is my preferred suite of tools for UnitTesting.
I have used both NUnit as well as MS Test. I like the integration of MS Test with the IDE and additional benefit of code coverage as well. But due to the performance reason as well as things like fluent assertions I prefer to use NUnit over MS test.
You can write framework agnostic asserts using a library called Should. It also has a very nice fluent syntax which can be used if you like fluent interfaces. I had a blog post related to the same.
http://nileshgule.blogspot.com/2010/11/use-should-assertion-library-to-write.html
If we use something like Should for assertions then both versions of test almost lokks the same and I don't see much difference between the two frameworks.
I had done a comparison of NUnit and MSTest unit testing frameworks in one of my blog.