What it does
MSTest provides test attributes, assertions, and a project SDK for .NET tests. The current Microsoft Learn guide recommends MSTest.Sdk, which supplies project defaults and works with the `dotnet test` workflow. Tests use attributes such as `TestClass` and `TestMethod` to mark fixtures and test methods. The framework source repository publishes an MIT license.
For a new C# project, Microsoft's getting-started guide recommends creating an MSTest project with MSTest.Sdk. Add a test class, mark a method with TestMethod, arrange the inputs, call the code under test, and assert the result. The same dotnet test tooling used by other .NET test projects can run the suite. These are documented steps; no test project was created or executed for this listing.
The overview distinguishes MSTest from the test execution platform. MSTest is the framework and adapter; the default MSTest.Sdk setup uses Microsoft.Testing.Platform, while VSTest remains an option for some configurations. That distinction matters when a repository's CI pipeline or existing test runner already selects a platform.
The microsoft/testfx repository contains MSTest and Microsoft.Testing.Platform components and publishes an MIT license. This record is about the test framework used to check .NET code, not Visual Studio itself or a managed test-hosting service.
Strengths
- The official project SDK simplifies a new MSTest project and provides recommended defaults.
- Test classes and methods use explicit attributes, and results integrate with standard .NET test tooling.
- The framework source is published under an official MIT license.
Watch out for
- A test suite requires a .NET project and code that expresses the expected behavior.
- Teams need to align MSTest's runner configuration with the execution platform used by local development and CI.
- The framework is intended for .NET testing rather than as a general cross-language test runner.
Best for
- C# and .NET teams writing unit tests with standard test attributes and assertions.
- Repositories that already use `dotnet test` or plan to adopt MSTest.Sdk.
- Teams that want to choose between the Microsoft.Testing.Platform default and supported runner configurations.
Sources
- MSTest overview (Oct 25, 2026)
- Get started with MSTest (Oct 25, 2026)
- Write tests with MSTest (Oct 25, 2026)
- MSTest and Microsoft.Testing.Platform repository (Oct 25, 2026)
- MIT License (Oct 25, 2026)
