Microsoft.AspNetCore.Mvc.Testing
10.0.1
Prefix Reserved
dotnet add package Microsoft.AspNetCore.Mvc.Testing --version 10.0.1
NuGet\Install-Package Microsoft.AspNetCore.Mvc.Testing -Version 10.0.1
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
paket add Microsoft.AspNetCore.Mvc.Testing --version 10.0.1
#r "nuget: Microsoft.AspNetCore.Mvc.Testing, 10.0.1"
#:package Microsoft.AspNetCore.Mvc.Testing@10.0.1
#addin nuget:?package=Microsoft.AspNetCore.Mvc.Testing&version=10.0.1
#tool nuget:?package=Microsoft.AspNetCore.Mvc.Testing&version=10.0.1
About
Microsoft.AspNetCore.Mvc.Testing provides support for writing integration tests for ASP.NET Core apps that utilize MVC or Minimal APIs.
Key Features
- Copies the dependencies file (
.deps.json) from the System Under Test (SUT) into the test project'sbindirectory - Sets the content root to the SUT's project root so that static files are found during test execution
- Provides the
WebApplicationFactoryclass to streamline bootstrapping the SUT withTestServer
How to Use
To use Microsoft.AspNetCore.Mvc.Testing, follow these steps:
Installation
To install the package, run the following command from the directory containing the test project file:
dotnet add package Microsoft.AspNetCore.Mvc.Testing
Configuration
To configure the test app, follow these steps:
- Specify the Web SDK in the test project file (
<Project Sdk="Microsoft.NET.Sdk.Web">). - Add references to the following packages:
xunitxunit.runner.visualstudioMicrosoft.NET.Test.Sdk
- Add a test class to the test project:
public class BasicTests : IClassFixture<WebApplicationFactory<Program>> { private readonly WebApplicationFactory<Program> _factory; public BasicTests(WebApplicationFactory<Program> factory) { _factory = factory; } [Theory] [InlineData("/")] [InlineData("/Index")] [InlineData("/About")] [InlineData("/Privacy")] [InlineData("/Contact")] public async Task Get_EndpointsReturnSuccessAndCorrectContentType(string url) { // Arrange var client = _factory.CreateClient(); // Act var response = await client.GetAsync(url); // Assert response.EnsureSuccessStatusCode(); // Status Code 200-299 Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); } }
Additional Documentation
For additional documentation and examples, refer to the official documentation on integration testing in ASP.NET Core.
Feedback & Contributing
Microsoft.AspNetCore.Mvc.Testing is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.TestHost (>= 10.0.1)
- Microsoft.Extensions.DependencyModel (>= 10.0.1)
- Microsoft.Extensions.Hosting (>= 10.0.1)
NuGet packages (261)
Showing the top 5 NuGet packages that depend on Microsoft.AspNetCore.Mvc.Testing:
| Package | Downloads |
|---|---|
|
Alba
Supercharged integration testing for ASP.NET Core HTTP endpoints |
|
|
Ardalis.HttpClientTestExtensions
Helpful extension methods to use when testing APIs in Functional Tests with xUnit. |
|
|
Volo.Abp.AspNetCore.TestBase
Package Description |
|
|
FastEndpoints.Testing
Integration/End-To-End testing helper library for FastEndpoints |
|
|
MELT.Serilog.AspNetCore
Helper for the MELT testing library to verify that the correct logs are generated by ASP.NET Core applications, when writing integration tests with Microsoft.AspNetCore.Mvc.Testing. |
GitHub repositories (317)
Showing the top 20 popular GitHub repositories that depend on Microsoft.AspNetCore.Mvc.Testing:
| Repository | Stars |
|---|---|
|
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
|
|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
|
|
|
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
|
|
|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
|
|
|
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 8.0 reference application, now community supported: https://github.com/NimblePros/eShopOnWeb
|
|
|
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 10, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
|
|
|
dotnet/eShop
A reference .NET application implementing an eCommerce site
|
|
|
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
|
|
|
elsa-workflows/elsa-core
A .NET workflows library
|
|
|
quartznet/quartznet
Quartz Enterprise Scheduler .NET
|
|
|
graphql-dotnet/graphql-dotnet
GraphQL for .NET
|
|
|
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
|
|
|
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 8 and newer.
|
|
|
kurrent-io/KurrentDB
KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.
|
|
|
domaindrivendev/Swashbuckle.AspNetCore
Swagger tools for documenting API's built on ASP.NET Core
|
|
|
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
|
|
|
jasontaylordev/NorthwindTraders
Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 10.0.1 | 420,596 | 12/9/2025 | |
| 10.0.0 | 913,240 | 11/11/2025 | |
| 10.0.0-rc.2.25502.107 | 49,595 | 10/14/2025 | |
| 10.0.0-rc.1.25451.107 | 56,229 | 9/9/2025 | |
| 10.0.0-preview.7.25380.108 | 25,988 | 8/12/2025 | |
| 10.0.0-preview.6.25358.103 | 6,407 | 7/15/2025 | |
| 10.0.0-preview.5.25277.114 | 10,006 | 6/6/2025 | |
| 10.0.0-preview.4.25258.110 | 6,485 | 5/12/2025 | |
| 10.0.0-preview.3.25172.1 | 3,726 | 4/10/2025 | |
| 10.0.0-preview.2.25164.1 | 3,221 | 3/18/2025 | |
| 10.0.0-preview.1.25120.3 | 127,356 | 2/25/2025 | |
| 9.0.11 | 557,334 | 11/11/2025 | |
| 9.0.10 | 1,526,216 | 10/14/2025 | |
| 9.0.9 | 1,842,348 | 9/9/2025 | |
| 9.0.8 | 1,774,600 | 8/5/2025 | |
| 9.0.7 | 1,305,477 | 7/8/2025 | |
| 9.0.6 | 1,606,864 | 6/10/2025 | |
| 9.0.5 | 1,582,881 | 5/13/2025 | |
| 9.0.4 | 2,081,852 | 4/8/2025 | |
| 9.0.3 | 1,700,936 | 3/11/2025 | |
| 9.0.2 | 1,687,926 | 2/11/2025 | |
| 9.0.1 | 1,710,705 | 1/14/2025 | |
| 9.0.0 | 3,611,909 | 11/12/2024 | |
| 9.0.0-rc.2.24474.3 | 56,113 | 10/8/2024 | |
| 9.0.0-rc.1.24452.1 | 28,927 | 9/10/2024 | |
| 9.0.0-preview.7.24406.2 | 10,881 | 8/13/2024 | |
| 9.0.0-preview.6.24328.4 | 11,962 | 7/9/2024 | |
| 9.0.0-preview.5.24306.11 | 4,852 | 6/11/2024 | |
| 9.0.0-preview.4.24267.6 | 3,873 | 5/21/2024 | |
| 9.0.0-preview.3.24172.13 | 71,171 | 4/11/2024 | |
| 9.0.0-preview.2.24128.4 | 5,799 | 3/12/2024 | |
| 9.0.0-preview.1.24081.5 | 26,274 | 2/13/2024 | |
| 8.0.22 | 794,075 | 11/11/2025 | |
| 8.0.21 | 985,072 | 10/14/2025 | |
| 8.0.20 | 1,070,069 | 9/9/2025 | |
| 8.0.19 | 1,853,607 | 8/4/2025 | |
| 8.0.18 | 981,645 | 7/8/2025 | |
| 8.0.17 | 1,483,299 | 6/10/2025 | |
| 8.0.16 | 1,371,266 | 5/13/2025 | |
| 8.0.15 | 2,123,673 | 4/8/2025 | |
| 8.0.14 | 2,156,382 | 3/11/2025 | |
| 8.0.13 | 2,438,112 | 2/11/2025 | |
| 8.0.12 | 2,289,375 | 1/14/2025 | |
| 8.0.11 | 6,086,607 | 11/12/2024 | |
| 8.0.10 | 8,001,901 | 10/8/2024 | |
| 8.0.8 | 8,917,555 | 8/13/2024 | |
| 8.0.7 | 6,533,551 | 7/9/2024 | |
| 8.0.6 | 5,323,685 | 5/28/2024 | |
| 8.0.5 | 2,426,000 | 5/14/2024 | |
| 8.0.4 | 6,407,629 | 4/9/2024 | |
| 8.0.3 | 3,980,672 | 3/12/2024 | |
| 8.0.2 | 3,626,673 | 2/13/2024 | |
| 8.0.1 | 4,010,629 | 1/9/2024 | |
| 8.0.0 | 6,588,343 | 11/14/2023 | |
| 8.0.0-rc.2.23480.2 | 58,828 | 10/10/2023 | |
| 8.0.0-rc.1.23421.29 | 62,561 | 9/12/2023 | |
| 8.0.0-preview.7.23375.9 | 11,108 | 8/8/2023 | |
| 8.0.0-preview.6.23329.11 | 28,326 | 7/11/2023 | |
| 8.0.0-preview.5.23302.2 | 12,977 | 6/13/2023 | |
| 8.0.0-preview.4.23260.4 | 266,378 | 5/16/2023 | |
| 8.0.0-preview.3.23177.8 | 3,895 | 4/11/2023 | |
| 8.0.0-preview.2.23153.2 | 2,184 | 3/14/2023 | |
| 8.0.0-preview.1.23112.2 | 41,154 | 2/21/2023 | |
| 7.0.20 | 615,691 | 5/28/2024 | |
| 7.0.19 | 93,323 | 5/14/2024 | |
| 7.0.18 | 201,082 | 4/9/2024 | |
| 7.0.17 | 412,384 | 3/12/2024 | |
| 7.0.16 | 458,165 | 2/13/2024 | |
| 7.0.15 | 586,846 | 1/9/2024 | |
| 7.0.14 | 995,863 | 11/14/2023 | |
| 7.0.13 | 2,467,565 | 10/24/2023 | |
| 7.0.12 | 737,226 | 10/10/2023 | |
| 7.0.11 | 3,591,407 | 9/12/2023 | |
| 7.0.10 | 1,467,879 | 8/8/2023 | |
| 7.0.9 | 1,266,964 | 7/11/2023 | |
| 7.0.8 | 934,976 | 6/22/2023 | |
| 7.0.7 | 515,389 | 6/13/2023 | |
| 7.0.5 | 3,080,532 | 4/11/2023 | |
| 7.0.4 | 1,685,585 | 3/14/2023 | |
| 7.0.3 | 1,562,066 | 2/14/2023 | |
| 7.0.2 | 1,534,095 | 1/10/2023 | |
| 7.0.1 | 889,547 | 12/13/2022 | |
| 7.0.0 | 3,067,567 | 11/7/2022 | |
| 7.0.0-rc.2.22476.2 | 69,396 | 10/11/2022 | |
| 7.0.0-rc.1.22427.2 | 23,060 | 9/14/2022 | |
| 7.0.0-preview.7.22376.6 | 7,916 | 8/9/2022 | |
| 7.0.0-preview.6.22330.3 | 2,702 | 7/12/2022 | |
| 7.0.0-preview.5.22303.8 | 9,631 | 6/14/2022 | |
| 7.0.0-preview.4.22251.1 | 2,309 | 5/10/2022 | |
| 7.0.0-preview.3.22178.4 | 1,394 | 4/13/2022 | |
| 7.0.0-preview.2.22153.2 | 1,243 | 3/14/2022 | |
| 7.0.0-preview.1.22109.13 | 5,268 | 2/17/2022 | |
| 6.0.36 | 1,521,490 | 11/12/2024 | |
| 6.0.35 | 252,850 | 10/8/2024 | |
| 6.0.33 | 1,390,781 | 8/13/2024 | |
| 6.0.32 | 340,491 | 7/9/2024 | |
| 6.0.31 | 481,379 | 5/28/2024 | |
| 6.0.30 | 167,064 | 5/14/2024 | |
| 6.0.29 | 726,793 | 4/9/2024 | |
| 6.0.28 | 438,168 | 3/12/2024 | |
| 6.0.27 | 663,735 | 2/13/2024 | |
| 6.0.26 | 932,124 | 1/9/2024 | |
| 6.0.25 | 1,752,990 | 11/14/2023 | |
| 6.0.24 | 861,262 | 10/24/2023 | |
| 6.0.23 | 622,771 | 10/10/2023 | |
| 6.0.22 | 1,018,073 | 9/12/2023 | |
| 6.0.21 | 1,385,862 | 8/8/2023 | |
| 6.0.20 | 1,310,738 | 7/11/2023 | |
| 6.0.19 | 771,314 | 6/22/2023 | |
| 6.0.18 | 511,415 | 6/13/2023 | |
| 6.0.16 | 2,612,669 | 4/11/2023 | |
| 6.0.15 | 1,469,748 | 3/14/2023 | |
| 6.0.14 | 1,824,525 | 2/14/2023 | |
| 6.0.13 | 2,341,479 | 1/10/2023 | |
| 6.0.12 | 2,534,862 | 12/13/2022 | |
| 6.0.11 | 2,878,102 | 11/7/2022 | |
| 6.0.10 | 4,386,946 | 10/11/2022 | |
| 6.0.9 | 3,313,194 | 9/13/2022 | |
| 6.0.8 | 4,286,853 | 8/9/2022 | |
| 6.0.7 | 3,553,765 | 7/12/2022 | |
| 6.0.6 | 2,637,324 | 6/14/2022 | |
| 6.0.5 | 3,263,969 | 5/10/2022 | |
| 6.0.4 | 3,059,452 | 4/11/2022 | |
| 6.0.3 | 3,209,585 | 3/8/2022 | |
| 6.0.2 | 3,135,938 | 2/8/2022 | |
| 6.0.1 | 4,521,617 | 12/14/2021 | |
| 6.0.0 | 5,344,979 | 11/8/2021 | |
| 6.0.0-rc.2.21480.10 | 206,213 | 10/12/2021 | |
| 6.0.0-rc.1.21452.15 | 173,772 | 9/14/2021 | |
| 6.0.0-preview.7.21378.6 | 7,512 | 8/10/2021 | |
| 6.0.0-preview.6.21355.2 | 4,595 | 7/14/2021 | |
| 6.0.0-preview.5.21301.17 | 3,370 | 6/15/2021 | |
| 6.0.0-preview.4.21253.5 | 6,738 | 5/24/2021 | |
| 6.0.0-preview.3.21201.13 | 5,090 | 4/8/2021 | |
| 6.0.0-preview.2.21154.6 | 1,097 | 3/11/2021 | |
| 6.0.0-preview.1.21103.6 | 1,169 | 2/12/2021 | |
| 5.0.17 | 754,846 | 5/10/2022 | |
| 5.0.16 | 114,340 | 4/11/2022 | |
| 5.0.15 | 219,954 | 3/8/2022 | |
| 5.0.14 | 218,178 | 2/8/2022 | |
| 5.0.13 | 512,708 | 12/14/2021 | |
| 5.0.12 | 619,924 | 11/7/2021 | |
| 5.0.11 | 1,064,399 | 10/12/2021 | |
| 5.0.10 | 1,078,658 | 9/14/2021 | |
| 5.0.9 | 1,197,526 | 8/10/2021 | |
| 5.0.8 | 939,635 | 7/13/2021 | |
| 5.0.7 | 1,218,664 | 6/8/2021 | |
| 5.0.6 | 960,448 | 5/11/2021 | |
| 5.0.5 | 1,400,760 | 4/6/2021 | |
| 5.0.4 | 841,807 | 3/9/2021 | |
| 5.0.3 | 1,003,412 | 2/9/2021 | |
| 5.0.2 | 950,158 | 1/12/2021 | |
| 5.0.1 | 593,399 | 12/8/2020 | |
| 5.0.0 | 1,798,643 | 11/9/2020 | |
| 5.0.0-rc.2.20475.17 | 15,282 | 10/13/2020 | |
| 5.0.0-rc.1.20451.17 | 9,319 | 9/14/2020 | |
| 5.0.0-preview.8.20414.8 | 9,387 | 8/25/2020 | |
| 5.0.0-preview.7.20365.19 | 3,939 | 7/21/2020 | |
| 5.0.0-preview.6.20312.15 | 2,285 | 6/25/2020 | |
| 5.0.0-preview.5.20279.2 | 1,113 | 6/10/2020 | |
| 5.0.0-preview.4.20257.10 | 1,740 | 5/18/2020 | |
| 5.0.0-preview.3.20215.14 | 2,221 | 4/23/2020 | |
| 5.0.0-preview.2.20167.3 | 1,099 | 4/2/2020 | |
| 5.0.0-preview.1.20124.5 | 1,357 | 3/16/2020 | |
| 3.1.32 | 529,151 | 12/13/2022 | |
| 3.1.31 | 104,240 | 11/8/2022 | |
| 3.1.30 | 796,614 | 10/11/2022 | |
| 3.1.29 | 78,420 | 9/13/2022 | |
| 3.1.28 | 126,980 | 8/9/2022 | |
| 3.1.27 | 113,281 | 7/12/2022 | |
| 3.1.26 | 128,302 | 6/14/2022 | |
| 3.1.25 | 145,121 | 5/10/2022 | |
| 3.1.24 | 147,542 | 4/11/2022 | |
| 3.1.23 | 211,349 | 3/8/2022 | |
| 3.1.22 | 626,029 | 12/14/2021 | |
| 3.1.21 | 452,299 | 11/7/2021 | |
| 3.1.20 | 418,950 | 10/11/2021 | |
| 3.1.19 | 279,358 | 9/14/2021 | |
| 3.1.18 | 816,288 | 8/10/2021 | |
| 3.1.17 | 578,481 | 7/13/2021 | |
| 3.1.16 | 503,841 | 6/8/2021 | |
| 3.1.15 | 450,319 | 5/11/2021 | |
| 3.1.14 | 790,066 | 4/6/2021 | |
| 3.1.13 | 926,329 | 3/9/2021 | |
| 3.1.12 | 559,971 | 2/9/2021 | |
| 3.1.11 | 723,185 | 1/12/2021 | |
| 3.1.10 | 2,191,933 | 11/9/2020 | |
| 3.1.9 | 2,363,169 | 10/13/2020 | |
| 3.1.8 | 2,063,592 | 9/8/2020 | |
| 3.1.7 | 1,609,893 | 8/11/2020 | |
| 3.1.6 | 1,806,232 | 7/14/2020 | |
| 3.1.5 | 2,186,107 | 6/9/2020 | |
| 3.1.4 | 1,535,992 | 5/12/2020 | |
| 3.1.3 | 2,464,248 | 3/24/2020 | |
| 3.1.2 | 2,035,707 | 2/18/2020 | |
| 3.1.1 | 1,818,034 | 1/14/2020 | |
| 3.1.0 | 2,180,266 | 12/3/2019 | |
| 3.1.0-preview3.19555.2 | 2,558 | 11/13/2019 | |
| 3.1.0-preview2.19528.8 | 1,287 | 11/1/2019 | |
| 3.1.0-preview1.19508.20 | 1,780 | 10/15/2019 | |
| 3.0.3 | 111,734 | 2/18/2020 | |
| 3.0.2 | 60,116 | 1/14/2020 | |
| 3.0.0 | 3,035,013 | 9/23/2019 | |
| 3.0.0-rc1.19457.4 | 10,932 | 9/16/2019 | |
| 3.0.0-preview9.19424.4 | 5,333 | 9/4/2019 | |
| 3.0.0-preview8.19405.7 | 17,257 | 8/13/2019 | |
| 3.0.0-preview7.19365.7 | 6,131 | 7/23/2019 | |
| 3.0.0-preview6.19307.2 | 4,851 | 6/12/2019 | |
| 3.0.0-preview5-19227-01 | 19,529 | 5/6/2019 | |
| 3.0.0-preview4-19216-03 | 2,265 | 4/18/2019 | |
| 3.0.0-preview3-19153-02 | 1,728 | 3/6/2019 | |
| 3.0.0-preview-19075-0444 | 3,997 | 1/29/2019 | |
| 3.0.0-preview-18579-0056 | 3,429 | 12/3/2018 | |
| 2.3.0 | 55,765 | 1/14/2025 | |
| 2.2.0 | 6,883,877 | 12/3/2018 | |
| 2.2.0-preview3-35497 | 16,420 | 10/17/2018 | |
| 2.2.0-preview2-35157 | 4,577 | 9/12/2018 | |
| 2.2.0-preview1-35029 | 7,652 | 8/22/2018 | |
| 2.1.3 | 1,511,547 | 10/1/2018 | |
| 2.1.2 | 367,891 | 8/21/2018 | |
| 2.1.1 | 1,011,272 | 6/18/2018 | |
| 2.1.0 | 929,337 | 5/29/2018 | |
| 2.1.0-rc1-final | 21,312 | 5/6/2018 | |
| 2.1.0-preview2-final | 5,359 | 4/10/2018 | |
| 2.1.0-preview1-final | 4,286 | 2/26/2018 |