开发者

VS2010 ASP.NET MVC add unit test to existing project

开发者 https://www.devze.com 2023-01-23 06:06 出处:网络
Is it possible to add the unit testing functionality (in Visual Studio 2010 We开发者_JAVA百科b Developer Express) for an already existing ASP.NET MVC project?AFAIK you don\'t have the option of creati

Is it possible to add the unit testing functionality (in Visual Studio 2010 We开发者_JAVA百科b Developer Express) for an already existing ASP.NET MVC project?


AFAIK you don't have the option of creating test projects with the VS Express versions as they are not supported. This answer also seems to support my assumption.

However, you can use NUnit as the testing framework by creating a new class library project and configuring VS accordingly. I used the method described in this blog post and it works. In summary, you configure NUnit such the test runner executes your test project's dll. You also setup and a handy menu bar item to actually start your tests.

If you are referring to the default MSTest functionality, there is probably no test runner available. Not sure what VS Express installs, but you may dig around to see if the mstest.exe file is available and then use the command line options to run your tests.

There is no perfect solution with testing when it comes to the express version of VS.


Yes. Add a test project to the solution

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号