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).

Image

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.