Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC .NET How to add unit test project in for existing source code?

I've already created MVC project (VS2008 .NET 3.5) at first time VS2008 ask me "Would you like to create Unit test project for this application ?" I choose No..

Now I realize that it's growing more complex and TDD (test driven development) approach would have been better.

but can't find out how to add a unit test project in my solution?

like image 580
aifarfa Avatar asked Feb 13 '10 08:02

aifarfa


People also ask

How can add unit test in ASP NET MVC?

Add a new unit test project to the MVC module solution. In Visual Studio's Solution Explorer, right-click on your MVC module solution and select Add > New Project. In the Add New Project dialog, select Unit Test Project, enter a name, and select the local folder to store it in.


1 Answers

Maybe this will help you

How to: Create a Test Project

As described in the following procedures, you can create test projects in several ways:

  • Create a test project when you add a test. When you create a new test, you can create new a test project into which the test will be added, or add the test to an existing test project that is already loaded.
  • Create a test project when you generate a unit test. When you generate unit tests, you can create a new test project into which the tests will be added, or add them to an existing test project.
  • Using the Add New Project dialog box. With this method, you use a dialog box to choose the programming language of your test project.
like image 191
Adriaan Stander Avatar answered Nov 06 '22 16:11

Adriaan Stander