MS Test Unit Tests in Visual Studio

Adding unit tests to a project:

  • Open the project in visual studio.

  • Select File” → “Add” → New Project → MSTest Test Project (select C# or Visual Basic (to match the project language).

  • Create the project.

  • Right-click the Unit test project name

  • Project Reference

  • Link the unit tests to the project folder corresponding to the application being tested.

 

Running existing unit tests:

  • Select Test → Run All Test