Unit Testing MVC and Web API Projects

The ASP.NET MVC and Web API project templates include the option to create a unit test project associated with your web project. When you create a new web project (File, New Project), Visual Studio launches the unified web application creation dialog, as shown in Figure 8.10. Notice the Add Unit Tests option in the lower left. Checking this box for the MVC and Web API templates ensures that a companion unit test project is created with all the proper references (including a reference to your web application).


FIGURE 8.10 You can include a unit test project with your ASP.NET application.

Notice in Figure ...

Get Microsoft Visual Studio 2015 Unleashed, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.