According to Professional ASP.NET MVC 1.0, page 8, "If you are using VS 2008 Standard Edition or Visual Web Developer 2008 Express you will need to download and install the NUnit, MBUnit or XUnit extensions for ASP.NET MVC in order for [the Create Unit Test Project] dialog to be shown."
Is there such an extension available to download for NUnit 2.4.8? If so where can I download it from?
If not, how can I set it up? I looked at the ASP.Net MVC and nUnit question and the articles How to: Add a Custom MVC Test Framework in Visual Studio and ASP.NET MVC Test Framework Integration Walkthrough. But they all refer to running devenv /setup
which doesn't seem to be available for Visual Web Developer 2008 Express. Has anyone gotten the Create Unit Test Project dialog working with NUnit and VWD Express? How so?
Thanks
I just found a blog article that also addresses this issue: NUnit VWD Express MVC setup « A Coders Life
The easiest way now in 2011 is to install this ASP.NET MVC NUnit extension from the Visual Studio gallery. The nice part is that this extension can be updated over time so you will have the latest nunit mvc template.
Have you installed the full .net 2.0 NUnit: http://www.nunit.org/index.php?p=download
In VWD Express, use
in lieu of
Edit: There's an easier solution below.
I got the Create Unit Test Project dialog working with NUnit and Visual Web Developer Express. I had to add an NUnit test template to the following location:
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress\ProjectTemplates\CSharp\Test\1033
(I had to create theTest\1033
subfolders).Then I ran
VWDExpress /setup
per Craig Stuntz's recommendation (from%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE
).And it worked!
Note: I had previously added registry settings from here but applied them to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VWDExpress\9.0\MVC\TestProjectTemplates
.For your convenience, here are the differences from the ASP.NET MVC Test Framework Integration Walkthrough article:
Step 1. Copy the template zip files to
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress\ProjectTemplates\CSharp\Test\1033
(note the VWDExpress folder)Step 2. Before merging the registry file(s), edit them to point to the appropriate location under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VWDExpress\9.0\MVC\TestProjectTemplates
(note the VWDExpress key)Step 4. Run
VWDExpress /setup
instead ofdevenv /setup
Thanks all that's great! I had a few wrinkles, because I only have MVC2 with VWD express 2010. So various things assumed in the earlier articles and pointers don't quite work out.
I made an outline for what helped me, starting with the base of: the templates and .CMD file in the "Updated NUnit Templates for ASP.Net MVC 1.0 RTM" article.
Registry entry meanings are covered in: "ASP.NET MVC Test Framework Integration"
I found it tedious, still persevere it will be worth it.