Wednesday, April 15, 2009

NUnit template for ASP.NET MVC

Hi there,

I've been struggling a bit with the automatic addition of NUnit unit tests to ASP.NET MVC project in Visual Web Developer. I wanted to have it the same way it works with the VisualStudio unit test framework that is being shown over and over again on the net.

So here's the complete solution: just unzip it, run install.bat and enjoy!

ASP.NET-MVC-NUnitTemplate.zip

Additionally to the standard files you'd expect to be in place there's a NUnit project file called UnitTests.nunit. It's already configured and ready to go. To open it with the NUnit test runner do a right click on it, select "Open with...", add a new program by using the "Add" button, select the nunit.exe file, click ok, highlight NUnit in the list, click "Set as Default" and click OK. From now on everytime you double-click on it you'll run the NUnit GUI test runner which is pretty much what you'd expect.

Padcom.

No comments: