Geeks With Blogs
Blog Moved to Blog Moved to
Brad Wilson and Jim Newkirk who are both from Microsoft announced earlier this week about the release of RC1.  They split the project into the core (xunit and console), and the extensions (Resharper runner, TestDriven.NET runner, etc)

What are some of the changes this time around?
  • Supports static methods
  • Console runs in the STA, so now you can use WatiN for tests
  • Removed sealed behavior from Assert classes which prevent extending
  • Documentation galore!
Ok, now that it's been announced, the question arises, do we need another xUnit testing framework for use in .NET?  What sets xUnit.NET apart?

Jim Newkirk, one of the original NUnit developers, laid out his reasons for xUnit and how it is different based upon lessons learned:
  • SIngle object instance per test method for test isolation
  • No Setup/Teardown functionality which is written about more here.
  • No ExpectedExceptionAttribute, instead uses Assert.Throws<T>
  • AOP like functionality for cross-cutting/weaving.  Brad posted more on this here.
  • Reducing custom attributes needed such as:
    • TestFixtureAttribute removed so tests can be anywhere
    • IgnoreAttribute removed or put property on FactAttribute
    • ExpectedExceptionAttribute removed and replaced with Assert.Throws<T>()
    • TestFixtureSetupAttribute and TestFixtureTearDownAttribute removed and implemented instead via the ITestFixture interface
  • Support for Generics
  • And so on
If you're looking for a good comparison between the xUnit frameworks, the CodePlex site has the details.  This page contains the comparison between NUnit, MbUnit, and MSTest in regards to Attributes and Assertions.
Now I'm a big fan of MbUnit, but I've decided to give this one a try for the past month or so.  I find the Assert.Throws for exception management to be a big gain here.  The problem is that your test could have multiple methods being called that could throw that exception which would make your test pass, but that's not what you were testing for.  I hope that MbUnit follows suit.  I need to look more into the AOP weaving as I'm also recently into Aspect Oriented Programming in .NET.

I'm going to continue playing with it, and seeing how it compares to MbUnit.  What's everyone using out there? Posted on Friday, December 21, 2007 12:13 AM Microsoft , .NET , Test Driven Development | Back to top

Comments on this post: RC1 Released

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Matthew Podwysocki | Powered by: