Uređivanje

Microsoft.Testing.Platform (MTP) features

MTP ships with built-in features and can be extended through NuGet packages.

When using Microsoft.Testing.Platform.MSBuild (included transitively by MSTest, NUnit, and xUnit runners), installing an extension NuGet package is all you need — extensions are automatically detected and registered, and the entry point is generated for you.

If you opt out of the auto-generated entry point by setting <GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>, you must register extensions manually in your Main method. Each extension page documents the manual registration call.

Extensions that require a NuGet package are shipped with their own licensing model (some less permissive), be sure to refer to the license associated with the extensions you want to use.

Some extensions are experimental: their APIs are annotated with the TPEXP diagnostic and might change in a future release, so you must acknowledge the diagnostic to use them. Experimental extensions are marked (experimental) in the following lists.

Start here

Use the following path based on your goal:

Choose by scenario

Built-in features

These features are part of the core platform and don't require additional NuGet packages.

Terminal output

Status and progress reporting to the terminal: output modes, ANSI support, and progress indicators.

Extension features

These features require installing NuGet packages.

Test reports

Generate test report files (TRX, HTML, JUnit, CTRF, Azure DevOps, GitHub Actions).

Code coverage

Collect code coverage data during test execution.

Crash and hang dumps

Collect process dump files when the test host crashes or hangs.

OpenTelemetry

Emit traces and metrics through OpenTelemetry during test runs.

Retry

Retry failed tests with configurable policies.

Hot Reload

Run tests with hot reload support for rapid iteration.

Microsoft Fakes

Run tests that use Microsoft Fakes for stubs and shims.

Telemetry

Telemetry collection. Learn how to opt out and what data is collected.

Diagnostics (experimental, introduced in MTP 2.3.0)

Capture evidence to diagnose a run, such as recording the screen with the video recorder.

Test host deployment (experimental, introduced in MTP 2.3.0)

Control how and where the test host is deployed and launched, such as deploying and launching a packaged-app test host.

Microsoft.Extensions integration (experimental, introduced in MTP 2.3.0)

Bridge platform and extension diagnostics into the Microsoft.Extensions.* libraries your application already uses, such as forwarding logs through the Microsoft.Extensions.Logging pipeline.