views:

150

answers:

3

Does anyobody 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

+2  A: 

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
cottsak
+1  A: 

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

Kindness,

Dan

Daniel Elliott
+1  A: 

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.

Eilon