CheckOps
MSTest
MSTest is Microsoft's MIT-licensed test framework for .NET, developed in the microsoft/testfx repository alongside Microsoft.Testing.Platform, a lightweight alternative to VSTest, with the MSTest.Sdk project SDK.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
MSTest (Microsoft Test Framework) is the test framework that ships with Visual Studio’s templates and is fully supported on all .NET platforms. Its home is the microsoft/testfx repository, which also hosts Microsoft.Testing.Platform, described as a lightweight alternative to VSTest for running tests, and its extensions.
Tests use attributes: [TestClass] on classes and [TestMethod] on methods, with [DataRow] and [DynamicData] for data-driven tests, [TestInitialize]/[TestCleanup] and class or assembly-level initialisers for fixtures. Modern MSTest versions add analyzers that catch common mistakes, in-assembly parallelisation, timeouts and retries. The MSTest.Sdk MSBuild project SDK greatly simplifies test project files by bringing in the right packages and defaults. Tests run from Visual Studio, VS Code, Rider and dotnet test. Version 4.5.2 was released on 27 October 2026.
The source code is at microsoft/testfx on GitHub under the MIT licence, with about 1,100 stars; the most recent commit was on 11 November 2026.
Features
- Built into .NET tooling: Default Visual Studio templates and
dotnet new mstest. - Data-driven tests:
[DataRow]and[DynamicData]. - Microsoft.Testing.Platform: Lightweight runner alternative to VSTest.
- Analyzers and parallelism: Catch mistakes and run tests in parallel.
Pros
- Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 11 November 2026.
Cons
- Less community-driven than xUnit: Many open-source .NET projects prefer xUnit or NUnit.
- Two runner models: VSTest and Microsoft.Testing.Platform options can confuse newcomers.
Usage and Links (Example)
dotnet new mstest -n Shop.Tests
[TestClass]
public class PricingTests
{
[TestMethod]
[DataRow(100, 0, 100)]
[DataRow(100, 10, 90)]
public void AppliesDiscount(int price, int pct, int expected)
{
Assert.AreEqual(expected, Pricing.Apply(price, pct));
}
[TestMethod]
public void RejectsNegativePrices()
{
Assert.ThrowsExactly<ArgumentOutOfRangeException>(() => Pricing.Apply(-1, 0));
}
}
dotnet test
Resources:
Pricing
MSTest is free and open source under the MIT licence.
Recommended for?
- .NET teams standardised on Microsoft tooling and Visual Studio.
- Projects wanting first-party support and the modern Microsoft.Testing.Platform.
Conclusion
MSTest is a modern, actively developed first-party .NET test framework, a safe default for Microsoft-centric teams.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with MSTest side by side.
XxUnit.netxUnit.net is a free, Apache-2.0, community-focused unit testing tool for C#, F# and Visual Basic, part of the .NET Foundation; v3 supports .NET 8+ and .NET Framework 4.7.2+.Compare with MSTest
NNUnitNUnit is an MIT-licensed unit-testing framework for all .NET languages on Windows, macOS and Linux, broad and non-opinionated, now at version 5 after NUnit 3 and 4.Compare with MSTest
MMoqMoq is a popular MIT-licensed mocking library for .NET that uses lambda expressions to set up and verify mocks; stable v4.x is maintained on the v4 branch while the main branch hosts the upcoming v5.Compare with MSTest
NNSubstituteNSubstitute is a BSD-3-Clause mocking library for .NET with a concise, readable syntax for creating substitutes, configuring returns and checking received calls.Compare with MSTest
CCoverletCoverlet is an MIT-licensed cross-platform code coverage framework for .NET, with line, branch and method coverage, available as a VSTest collector, MSBuild integration or global tool.Compare with MSTest
RReqnrollReqnroll is a BSD-3-Clause .NET port of Cucumber based on the SpecFlow code base, running Gherkin scenarios with MSTest, NUnit, xUnit or TUnit on .NET Framework 4.6.2+ through .NET 10.Compare with MSTest