Skip to main content
net8.0net9.0net10.0

Experimental package. Test fakes for integration testing

Published
Sep 9, 2026
1mo ago
Total Downloads
125.2K
125,194

Install

dotnet add package Microsoft.AspNetCore.Testing --version 10.10.0
ProductVersions
.NET
net10.0net8.0net9.0

README

Microsoft.AspNetCore.Testing

This package provides test fakes for integration testing of ASP.NET Core applications.

In particular:

  • IWebHostBuilder extensions to setup the test web app.
  • IHost extensions to access that test web app.

Install the package

From the command-line:

dotnet add package Microsoft.AspNetCore.Testing

Or directly in the C# project file:

<ItemGroup>
  <PackageReference Include="Microsoft.AspNetCore.Testing" Version="[CURRENTVERSION]" />
</ItemGroup>

Usage Example

Creating a Test Web App

The IWebHostBuilder extensions can help set up a host for testing.

using var host = await FakeHost.CreateBuilder()
    .ConfigureWebHost(webHost => webHost.UseFakeStartup().ListenHttpOnAnyPort())
    .StartAsync();

Accessing the test Web App

The IHost extensions can help access the test host that was created above.

using var client = host.CreateClient();

var response = await client.GetAsync("/");

Feedback & Contributing

We welcome feedback and contributions in our GitHub repo.

Changes from Previous Version

No structural changes between v10.9.0 and v10.10.0.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.