开发者

In Asp.net MVC project is it possible to add a test project later?

Does anyobo开发者_JS百科dy can explain me, how to add a test project to the asp.net MVC project after I created them without it.

I'm using ASp.net MVC 2 beta on VS2008 Dotnetframework 3.5

Thanks in advance

Gabriel


Yeh, i do it all the time. Within VS08:

  • Right-click on the solution in the Solution Explorer,
  • Select Add > New Project...
  • Select the "Test" Project Type from the list on the left (choose a language section 1st, like Visual C#) then
  • Select Test Project from right pane
  • Name it in the text field below (a good convention is ExistingProjectName.Test, then click OK


In addition to what Cottsak says; you will most likely need to add a project reference to your MVC project.

Kindness,

Dan


Please note that there is no way to add the default ASP.NET MVC Test Project after a project has already been created. That is, you won't be able to get the sample HomeControllerTests and AccountControllerTests. The easiest way to get those is to add an additional full ASP.NET MVC Web Application Project with tests and then copy the code over.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜