Writing Unit Tests for the .NET Framework with the Microsoft Unit Test Framework for Managed Code


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

In this section Walkthrough: Creating and Running Unit Tests for Managed Code

Quick Start: Test Driven Development with Test Explorer

Using Microsoft.VisualStudio.TestTools.UnitTesting Members in Unit Tests

Using the Assert Classes

How To: Create a Data-Driven Unit Test

Unit tests for Generic Methods

How to: Target an Earlier Version of .NET

Sample Project for Creating Unit Tests