Microsoft.AspNetCore.Testing 8.4.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Microsoft.AspNetCore.Testing --version 8.4.0
NuGet\Install-Package Microsoft.AspNetCore.Testing -Version 8.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="8.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.AspNetCore.Testing --version 8.4.0
#r "nuget: Microsoft.AspNetCore.Testing, 8.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.AspNetCore.Testing as a Cake Addin
#addin nuget:?package=Microsoft.AspNetCore.Testing&version=8.4.0

// Install Microsoft.AspNetCore.Testing as a Cake Tool
#tool nuget:?package=Microsoft.AspNetCore.Testing&version=8.4.0

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.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Microsoft.AspNetCore.Testing:

Package Downloads
Dazinator.AspNet.Extensions.FileProviders.Tests

Package Description

GitHub repositories (29)

Showing the top 5 popular GitHub repositories that depend on Microsoft.AspNetCore.Testing:

Repository Stars
aspnet/Mvc
[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
aspnet/KestrelHttpServer
[Archived] A cross platform web server for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
aspnet/SignalR
[Archived] Incredibly simple real-time web for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
aspnet/Identity
[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
aspnet/Security
[Archived] Middleware for security and authorization of web apps. Project moved to https://github.com/aspnet/AspNetCore
Version Downloads Last updated
9.0.0-preview.3.24209.3 103 4/11/2024
9.0.0-preview.2.24157.4 62 3/12/2024
9.0.0-preview.1.24108.1 100 2/13/2024
8.4.0 219 4/9/2024
8.3.0 977 3/12/2024
8.2.0 431 2/13/2024
8.1.0 471 1/9/2024
8.0.0 508 11/14/2023
8.0.0-rtm.23558.11 65 11/14/2023
8.0.0-rc.2.23510.2 97 10/10/2023
8.0.0-rc.1.23453.1 180 9/12/2023
8.0.0-preview.7.23407.5 257 8/8/2023