The Unit Testing Framework

The unit testing framework is part of Visual Studio (and not the .NET Framework itself). Unit testing in Visual Studio includes a set of framework classes, the tools, and the execution host. You can find the namespace that contains the unit testing framework classes at Microsoft.VisualStudio.TestTools.UnitTesting. Developers are most interested in the attribute classes and the Assert class in this namespace. This section highlights the core usage scenarios for both the attribute and the assertion classes (among others).

Note

The namespace for unit testing is Microsoft.VisualStudio.TestTools.UnitTesting. However, you set a reference to the assembly Microsoft.VisualStudio.QualityTools.UnitTestFramework.

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.