How do I add NUnit as a test framework option for ASP.NET MVC to Visual Web Developer 2008 Express?

前端 未结 9 934
庸人自扰
庸人自扰 2021-01-31 10:33

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 instal

相关标签:
9条回答
  • 2021-01-31 11:29

    Have you installed the full .net 2.0 NUnit: http://www.nunit.org/index.php?p=download

    0 讨论(0)
  • 2021-01-31 11:33

    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.

    1. Back-up your registery
    2. Unzip the nunitRTM.zip file from 1.
    3. You can run the command file, it doesn't look for VWDexpress 2010; so look carefully to see how much you need to fix-up or do manually (see following steps)
    4. Copy the template (.ZIP) files to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VWDExpress\ProjectTemplates ... Csharp\test and VisualBasic\test
    5. I made two registry update files: Csharp\NUnitExpress2010.reg and VisualBasic\NUnitExpress2010.reg; from the Csharp\NUnitExpress.reg and VisualBasic\NUnitExpress.reg files (respectively).
    6. The main difference is the use registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft**VWDExpress****10.0****MVC2**\TestProjectTemplates
      Registry entry meanings are covered in: "ASP.NET MVC Test Framework Integration"
    7. Update the reistry: regedit.exe /s "Visual Basic\NUnitExpress2010.reg" (e.g.)
    8. Run set-up for Visual Web Designer: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VWDExpress.exe" /setup
    9. Fire-up VWD express and open a new project -- There were the nUnit templates.

    I found it tedious, still persevere it will be worth it.

    0 讨论(0)
  • 2021-01-31 11:38

    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 the Test\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 of devenv /setup

    0 讨论(0)
提交回复
热议问题