My Resume

  • My Resume (MS Word) My Resume (PDF)


  • Microsoft Most Valuable Professional
  • INETA Community Champion
  • Leader, NJDOTNET: Central New Jersey .NET User Group

Friday, May 11, 2007

NUnit and MSTest working in harmony

For my latest project at Infragistics, we decided it would be prudent to take the TDD approach. We do all our development in Visual Studio 2005, however most of us do not have the Team System edition and are left without the MSBuild/MSTest framework it provides. Those of us without VS2k5: TS who want to try our hand at TDD have to find another suitable framework and - as anyone who has ever searched for .NET unit testing knows - the natural course of Googling will inevitably bring you to NUnit. During a discussion about which testing framework to "standardize" on in our group, Ambrose came across this MSDN Magazine article which - in addition to being an informative article overall - has a great tidbit about writing tests that work under both NUnit and MSTest. And, like any great tip, it's incredibly simple and boils down to defining aliases for the various attributes you use. A little more searching, and I found this complimentary blog entry that sheds a little more light on just what attributes match up together.

Unfortunately, choosing to go this route means that you're limited to the lowest common denominator when it comes to what attributes and Asserts you can use (at least without having to add "#if NUNIT" directives everywhere), but when you're looking for a cross-test-platform solution like we were, it's a pretty good compromise!