19 August 2011

Unit Testing

I a recent post I showed how to unit test CRM 4 plugins. In the post I used Rhino.Mocks to mock the CRM interfaces and MSTest. Since then I've been doing some more "playing" with unit testing and I've stopped using MSTest, now I'm using NUnit instead.

There's a pretty good comparison between MSTest and NUnit on the "Musings of a Bare Bones Coder" blog (http://www.barebonescoder.com/2010/06/mstest-vs-nunit-with-visual-studio-2010-tdd/) so I'm not going into that here. As is said NUnit does suffer in that it has to be run outside of Visual Studio and the author suggests using TestDriven.Net (http://www.testdriven.net/), which is good but I've since found Visual NUnit 2010 which is a freebie on the MSDN Visual Studio Gallery (http://visualstudiogallery.msdn.microsoft.com/c8164c71-0836-4471-80ce-633383031099).

Using Rhino.Mocks, NUnit, and Visual NUnit 2010 seems to be exactly what the doctor ordered in terms of unit testing your code straight from Visual Studio.

I will block with some more details about these tools later.

No comments:

Post a Comment