Creating a Test Project

Your unit tests must exist inside a test project. This is a project that has the right references to the unit testing framework and the configuration required to be run via the test tool built inside Visual Studio. There are two primary ways you can initiate the creation of a unit test project: You can create an empty test project from scratch, or you can automatically generate unit tests into a new test project for existing code. We start with the first option.

The Test Project Template

You create a new test project in Visual Studio through the Add New Project dialog box (File, New, Project). Inside this dialog box, you navigate to the Test node under your preferred language, as shown in Figure 8.1. Notice that you can ...

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.