ASP.NET MVC NUnit

Free

Adds a project and an item template to generate NUnit based tests of ASP.NET MVC 3 and ASP.NET MVC 4 applications. NUnit as NuGet package is included and does not require any dedicated installation anymore.

(7) Review
Visual Studio
2010
Download (15,730)
1/23/2013
0.6
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (7)
Q and A (7)
Sign in to write a review
Sort by:

by Manuel Wenk | April 13 2012

Pretty cool Tool! I'm using it daily...

by thnk2wn | April 13 2012

Nice. Do you plan on updating this or doing another one to support ASP.NET MVC 4?

by Dzmuh | January 12 2012

Thanks!

by secretGeek | July 01 2011

by Jay R. Wren | June 22 2011

This is a must have for anyone doing ASP.NET MVC.

by Phil.Wheeler | May 31 2011

This extension finally makes getting NUnit test templates into your MVC3 applications easy; something which has always been a major point of pain for developers.

There's nothing particularly elaborate that happens here, the extension is simple and effective. Your NUnit project is not created with the latest production release of the NUnit framework (at time of writing, the latest version is 2.5.10 where the template installs with 2.5.9) but this is forgiveable and one would assume that regular updates would correct this issue periodically, although perhaps more attention could be paid to the NUnit release cycle.

Project classes and references are all named correctly and the suite of AccountController classes are thorough and correct.

Overall, this makes life infinitely easier for plugging NUnit test templates into your MVC3 projects.

by Monomachus | April 16 2011

Nice job, I'm glad there is someone like you to make this possible.

Sign in to start a discussion


  • Now broken?
    5 Posts | Last post October 01, 2013
    • I'm having problems using this extension. When creating the project I get:
      
      Could not add all required packages to the project. The following packages failed to install from 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Packages':
      
      Newtonsoft.Json.4.5.6 : Unable to find version '4.5.6' of package 'Newtonsoft.Json'.
      
      Microsoft.AspNet.Razor.2.0.20710.0 : Unable to find version '2.0.20710.0' of package 'Microsoft.AspNet.Razor'.
    • Hi Alex,
      
      might be that some packages were update to new versions. Will try to fix the templates to have a minimum required version and not to have a fixed version. As I am of to the build conference soon new version might be delayed slightly. 
      
      Cheers,
      Marcus
    • No worries, that sounds like it will be a good solution.
    • I also encountered the same problems, looking forward to solve it as soon as possible.
      
    • Hey guys,
      
      sorry for the delay. I fixed the extension for VS2012 now (http://visualstudiogallery.msdn.microsoft.com/3c266165-7142-4012-974c-fa750cf97850) but when I tried to fix it for the VS 2010 I came across the situation that my assemblies still have the old version. Might it be that you guys have VS2010 and VS2012 installed in parallel and that VS2012 has update 3 installed?
      
      Cheers,
      Marcus
  • Any chance for upgrading this to VS 2012?
    5 Posts | Last post April 18, 2013
    • Is there any chance in upgrading this extension to work with Visual Studio 2012?
    • Sorry for the late reply :-)
      
      See my last answer on Michael's question. Still got some trouble - maybe I find a way to fix it on the weekend.
    • I am running version 0.6 and upon creation of a new solution with a NUnit test project, I get a Package Installation Error. It cannot find the following Newtonsoft.Json.4.5.6 and Microsoft.AspNet.Razor.2.3.20710.0. 
      
      Is it missing some dependencies? Installing with default test package generates no errors.
    • hey keith,
      
      those dependencies are linked from the ASP.NET MVC 4 repository - which MVC version do you have installed? The MVC 4 repository should be somewhere like: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Packages all dependencies should "live" there.
      
      Cheers,
      m.
    • thanks for your reply.
      
      Checking that directory, I see I have version Newton.Json.4.5.11 and Microsoft.AspNet.Razor.2.0.20715.0. It looks like we are not matching on version.
      
      Having said that, my supervisor has announced we are going in a different direction, making this whole discussion academic from my point of view. 
      
      thanks again.
  • Not able to install in VS2012
    4 Posts | Last post March 05, 2013
    • Hi,
      
      I cant install this in VS2012 Premium.
      
      Is it because I have Update 2 CTP3 installed?
      
      I get an error "This extension is not installable on any currently installed products".
      
      Regards
      
      Simon
    • Hi Simon,
      
      have you tried the VS2012 extension (http://visualstudiogallery.msdn.microsoft.com/3c266165-7142-4012-974c-fa750cf97850) ? I needed to separate VS2010 and VS2012 because of the NuGet references inside the templates.
      
      Have you tried to install from within the Extension Manager or the plain VSIX?
    • Ah - my fault ;-)
      
      Yes, I did use that one. I stupidly didnt take note of the fact that is the same extension but for different versions of VS.
      
      And, yes, this one worked perfectly.
      
      Thank you for your very prompt response.
      
      Simon
    • awesome!
      
      cheers, mate.
  • Is Visual Web Developer 2010 Express Supports this?
    4 Posts | Last post December 03, 2012
    • Please advise me, is there any option for adding this to Microsoft Visual Web Developer 2010 Express?
    • Hi Dineshkumar,
      
      unfortunately Express versions do not have any built-in support for testing projects which this add-on depends on. So quick answer is "no" ;-)
      
      Only possibility is to add NUnit reference and project manual.
      
      Cheers,
      Marcus
    • Hey Dineshkumar,
      
      hm - I am geting outdated ;) I recently saw that my statement is incorrect! :( The VWD version should be able to have extensions and test-support. So I am checkin for VWD compliance.
      
      Sorry!
      
      cheers,
      m.
    • Thanks Marcus, Please let me know if any break through..
  • Is it supports MVC4 Pllications
    3 Posts | Last post November 30, 2012
    • I installed the version .5. When I create a MVC3 App it supports nunit as the unit testing framework. But when it comes with MVC4 it doesn't.I saw in a review someone asking "Do you plan on updating this or doing another one to support ASP.NET MVC 4?". Isn't it supporting MVC4 apps. Thanks in advance. 
    • hey manura,
      
      I am assuming you are using VS2012? Until yesterday I was struggling hard with problems for VS2012 support. I was able to solve these and guess what... I am having already the next ones. ASP.NET MVC 4 uses nuget to embed its assemblies. The path to the packages is written into the registry (which is a bad thing I think). The main problem: the key to the registry is different on VS2010 and VS2012 (aka VS11). In the .vstemplate file there is no "condition" based on VS version possible. So I could either break VS2010 support and just go with VS2012 (which I don't want) or spend another time to have a special wizard extension to support different VS versions. I figured that out just yesterday (which took a really long time because there is no documentation on that). As I am doing this in my spare time I gues you have to be patient a little more time ;) There will be an update coming up the next weeks supporting VS2010, VS2012, MVC3, MVC4, C# and VB.
      
      cheers,
      m.
    • Hi M,
      Thanks a lot for the reply.I'm using vs2010 professional Edition sp1.
  • 0.6 release
    2 Posts | Last post November 08, 2012
    • Any idea when the 0.6 release might ship? (Or alternatives, if you are not planning to proceed?) Thx
    • Hadn't had a chance to look deeper into it by now. Only solution so far I can think about is to drop backwards compatibility with MVC 3 (would wonder if still someone is using that - and if so no upgrade would be required). Then I could release v0.6 soon. But I would like to look into the problem by one more time - maybe I find some time at the weekend.
      
      Cheers.
  • AccountController does not contain a definition for FormsService on new project
    5 Posts | Last post March 15, 2012
    • I'm getting the below error on brand new box.  I've update VS sp1 and april '11 tools update.  There is no FormsService off the AccountController.  Any idea what's going on?
      
      thx,Dan 
      
      'MvcApplication4.Controllers.AccountController' does not contain a definition for 'FormsService' and no extension method 'FormsService' accepting a first argument of type 'MvcApplication4.Controllers.AccountController' could be found (are you missing a using directive or an assembly reference?)	c:\users\danieleli\documents\temp\MvcApplication4\MvcApplication4.Tests\Controllers\AccountControllerTest.cs	128	71	MvcApplication4.Tests
      
    • Hey, I am getting the same problem. The Accounts controller does not contain either FormsService or MembershipService as I believe it should based on other code I've seen for MVC3. The test utility method GetAccountController() tries to create a Account Controller with these variables, but they don't exist so the whole thing fails and none of the tests can be used.
      
      I'm woundering if the Accounts controller code in the template is from a differenct version of MVC or something strange like that?
    • Just as an update I think there may have been changes to the Account Controller for security reasons (Open Redirect Attack).
      
      http://weblogs.asp.net/jgalloway/archive/2011/01/25/preventing-open-redirection-attacks-in-asp-net-mvc.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+jongalloway+%28Jon+Galloway%29
      
      You can also see progress on development here: 
      http://blog.kimpenhaus.de/asp.net-mvc-nunit-test-template-on-visual-studio-gallery
    • He guys,
      this problem is due to Tools Update for ASP.NET MVC 3 as they changed the default project template and its controller classes. This will be fixed in vNext coming up shortly. Temporary solution could be deleting the faulted tests (as they are only a template).
      
      Thanks for pointing out the problem.
      m.
    • After downloading the file ASP.NET MVC Nunit.vsix from your site, I click on it to install and I get error message "This extension is not installable on any currently installed products"  I have VWD Express 2010 sp1 and MVC3 and Windows 7 Pro. I want to be able to create NUnit test projects. I wasn't able to do it in VWD 2008 Express, i was hoping it would work in 2010 Express. Please help