Use this process if you are writing the application logic from scratch, or are importing it from elsewhere. If the application
logic that you plan to test already exists, you may find that the process explained in
Create a Unit Test Project and Test Program for Existing Code is better. For ease of use, we recommend that you organize your solution/projects as described in
Organizing Your Projects when using this process.
-
From the Visual Studio IDE, click
.
-
In the
Create a new project dialog box, click
on the
All Project Types filter and select
Test.
The list of available projects filters on test projects.
-
Select the
Unit Test Library project template.
-
In the
Project name field, specify a name for the project.
-
Specify where to create the project:
- To create the project in a new solution, leave the
Solution field set to
Create new solution, and enter a name in the
Solution name field.
- To add the project to an existing solution, click
Create new solution and select
Add to solution from the list displayed, then select the required solution.
-
Click
Create.
You now need to add a test program to the project to start creating test cases.