Get started with MSTest
MSTest functionality is split into multiple NuGet packages:
- MSTest.TestFramework: Contains the attributes and classes that are used to define MSTest tests.
- MSTest.TestAdapter: Contains the test adapter that discovers and runs MSTest tests.
- MSTest.Analyzers: Contains the analyzers that helps you write high-quality tests.
We recommend that you don't install these packages directly into your test projects. Instead, you should use either:
MSTest.Sdk: A MSBuild project SDK that includes all the recommended packages and greatly simplifies all the boilerplate configuration. Although this is shipped as a NuGet package, it's not intended to be installed as a regular package dependency, instead you should modify the
Sdk
part of your project (e.g.<Project Sdk="MSTest.Sdk">
or<Project Sdk="MSTest.Sdk/X.Y.Z">
whereX.Y.Z
is MSTest version). For more information, please refer to MSTest SDK overview.the MSTest NuGet package, which includes all recommended packages:
MSTest.TestFramework
,MSTest.TestAdapter
,MSTest.Analyzers
andMicrosoft.NET.Test.Sdk
.
If you are creating a test infrastructure project that is intended to be used as a helper by multiple test projects, you should install the MSTest.TestFramework
and MSTest.Analyzers
packages directly into that project.