Needing to use unit testing with MS Visual Web Developer 2008 Express Edition, I was a little stumped at first as VWD Express doesn't have the Create Unit Test Project dialog box when creating new projects.
Selecting NUnit to use for unit testing wasn't too tough a choice (Visual Studio ships with Visual Studio Team Test but not with VWD 2008 Express). It's free, proven with a track record, and is widely used.
First off NUnit needed to be downloaded and installed. Without stating the obvious NUnit can be downloaded from the website.
After installing NUnit, I grabbed the NUnit Test Templates from Updated NUnit Templates for ASP.Net MVC 1.0 RTM, on the Visual Web Developer Team Blog, and followed the pretty straight forward instructions - unzipped the file and ran installNUnit.cmd.
Everything ran as sweet as after that, with the Create Unit Test Project dialog box popping up after starting up VWD 2008 Express and allowing unit testing of projects.
The comments on the blog entry linked to above seem to throw up a couple of issues and I'm not sure how well this would perform on Windows 7 as I installed on Vista, but I had no problems getting it up and running.
Bug free code... here we come!!!
MS Visual Web Developer 2008 Express Edition can be downloaded from here.
Selecting NUnit to use for unit testing wasn't too tough a choice (Visual Studio ships with Visual Studio Team Test but not with VWD 2008 Express). It's free, proven with a track record, and is widely used.
First off NUnit needed to be downloaded and installed. Without stating the obvious NUnit can be downloaded from the website.
After installing NUnit, I grabbed the NUnit Test Templates from Updated NUnit Templates for ASP.Net MVC 1.0 RTM, on the Visual Web Developer Team Blog, and followed the pretty straight forward instructions - unzipped the file and ran installNUnit.cmd.
Everything ran as sweet as after that, with the Create Unit Test Project dialog box popping up after starting up VWD 2008 Express and allowing unit testing of projects.
The comments on the blog entry linked to above seem to throw up a couple of issues and I'm not sure how well this would perform on Windows 7 as I installed on Vista, but I had no problems getting it up and running.
Bug free code... here we come!!!
MS Visual Web Developer 2008 Express Edition can be downloaded from here.
Hi Jay, Thanks for the good links. I did all this but this didn't happen:
ReplyDelete“Everything ran as sweet as after that, with the Create Unit Test Project dialog box popping up after starting up VWD 2008 Express and allowing unit testing of projects.” I get no dialog pop-up.
My dilemma is I don't know how to connect a VWD project to an Nuint project.
In C#, you create a library and add methods, then you can automatically generate a C# unit test. I’m trying everything I can find to do the same with VWD 2008 and Nunit.
Any comments would be appreciated.
Thanks.
Hi Anonymous,
ReplyDeleteThe pop up box and integration into VWD Express 2008 is a result of changes to the registry.
Make sure you run installNUnit.cmd as admin if you're on Vista or higher machines.
If you haven't installed VWD Express 2008 in the default location you'll need to edit installNUnit.cmd and update the file paths to locations that match your installed version of VWD Express 2008.
In VWD Express 2008, you can still add a new class library project if you've started off with a web project and a solution file will be created for you. When the projects are built you can use the resulting dlls independently in nUnit.
Hope this helps you, gives you a few pointers, and you can get it working.
I've upgraded to VWD Express 2010 and uninstalled 2008 so I'm a bit rusty on this now.
NB. I'm sure you know messing with the registry can be pretty dangerous so I can't take any liability if things go a little wrong! :-)
What about the installation in VWD 2010 express? All the paths in the .cmd file are VWD 9.0 relative so none is executed...
ReplyDeleteHi Anonymous,
ReplyDeleteI've wasn't able to get this working in VWD2010 Express. You can still run tests on your code using NUnit as a standalone application. You just don't get all the nice plu-in integrated features with the IDE.
Sorry not to be of more help on this one.
Jay