Meanwhile ASP.NET MVC 3 RTM has arrived - this template is still good to go even for RTM version. As you can see in the comments I initially forgotten to explicitly mention that the originally template was x64 only. As an result I tried to change the .bat file accordingly to handle x86 platforms as well. So when you download the newly packed template this should determine if your system is x86 or x64 and call the proper files for installing the template correctly.
The first template also contains a reference to a specific NUnit version even when version-specific switch for Visual Studio was set to false I removed this version-reference.
What ships with that release again is the possibility to create new test- projects (according to a new created projects), from the build-in project templates, which does use the Microsoft unit-testing framework (in the wizard called Visual Studio Unit Test). This isn’t anything new!
Based on Piotr’s MVC 2 test-project template I updated it (based on the shipped MvcWebApplicationTestProjectTemplatev3.0.cs.zip) to be compatible with ASP.NET MVC 3 (RC2) and changed the notation to Assert.That(…, Is-constraint) - which I prefer while using NUnit. So the vstemplate looks like this now:
If you compare it to the old MVC 2 template you will probably notice that the extension wizard is gone. Don’t know why - maybe we should ask @haacked about that…
A sample of the generated NUnit-Tests (as of the HomeController):
To use the new template you still need a registry key referring to the new package. The one I used is only x64 compatible. Remember: The GUID’s of the vstemplate and the registry need to match.
Alongside to the updated registry entry I added an install.bat file which does the necessary steps
insert registry key
copy template archive
update Visual Studio 2010 project template cache
It isn’t much about magic glue in it, just for completeness sake I post the batch-script:
After executing the install.bat and creating a new ASP.NET MVC 3 application the project template should show up as following:
I packed an archive containing all the stuff (reg key, vstemplate.zip and install.bat). Feel free to download :-)