Explore the Microsoft Testing Platform (MTP) — the modern, lightweight replacement for VSTest — with practical examples across the most popular .NET test frameworks: xUnit v3, TUnit, MSTest, and legacy xUnit v2. Each project shows how to wire up the framework with MTP, run tests as standalone executables, and take advantage of the new extensibility model.
| Project | Framework | Description |
|---|---|---|
MicrosoftTestingPlatformExamples.SystemUnderTestProject |
— | The production code being tested across all test projects |
MicrosoftTestingPlatformExamples.TestsWithMSTest |
MSTest | Tests using MSTest with native Microsoft Testing Platform support |
MicrosoftTestingPlatformExamples.XUnit |
xUnit v3 | Tests using xUnit v3 with first-class MTP integration and standalone executable output |
MicrosoftTestingPlatformExamples.LegacyXUnit |
xUnit v2 (legacy) | Tests demonstrating xUnit v2 compatibility mode under MTP |
MicrosoftTestingPlatformExamples.TUnit |
TUnit | Tests using TUnit, a framework built entirely on Microsoft Testing Platform |
- Clone the repository
- Open
MicrosoftTestingPlatformExamples.slnin Visual Studio 2022+ (or usedotnet test) - Run all tests:
dotnet test - Run a single test project as a standalone executable:
dotnet run --project MicrosoftTestingPlatformExamples.XUnit
- Microsoft Testing Platform — a lightweight, AOT-compatible test runner replacing VSTest; test projects compile as self-contained executables
- xUnit v3 — the latest xUnit release with native MTP support and improved parallelism
- TUnit — a new .NET test framework built from the ground up on Microsoft Testing Platform with source-generated test discovery
- Legacy xUnit (v2) — demonstrates backward-compatible usage of older xUnit projects under MTP
If you found this useful and you want to learn more about C#, .NET, and software engineering, subscribe to the free Dev Leader Weekly newsletter:
Subscribe to Dev Leader Weekly
- All Links
- Website - Dev Leader
- YouTube - Dev Leader
- YouTube - Dev Leader Path To Tech
- YouTube - Dev Leader Podcast
- YouTube - CodeCommute
- Newsletter - Dev Leader Weekly
- LinkedIn - Nick Cosentino
- GitHub - ncosentino
- Twitter/X - Dev Leader
- Threads - Dev Leader
- Bluesky - Dev Leader
- Mastodon - Dev Leader
- Facebook - Dev Leader
- TikTok - Dev Leader
- Twitch - Dev Leader
- Stack Overflow - Nick Cosentino
Powered by BrandGhost 👻



