Microsoft.AspNetCore.Mvc.Testing
10.0.0-preview.4.25258.110
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.AspNetCore.Mvc.Testing --version 10.0.0-preview.4.25258.110
NuGet\Install-Package Microsoft.AspNetCore.Mvc.Testing -Version 10.0.0-preview.4.25258.110
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.4.25258.110" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.4.25258.110" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
paket add Microsoft.AspNetCore.Mvc.Testing --version 10.0.0-preview.4.25258.110
#r "nuget: Microsoft.AspNetCore.Mvc.Testing, 10.0.0-preview.4.25258.110"
#:package Microsoft.AspNetCore.Mvc.Testing@10.0.0-preview.4.25258.110
#addin nuget:?package=Microsoft.AspNetCore.Mvc.Testing&version=10.0.0-preview.4.25258.110&prerelease
#tool nuget:?package=Microsoft.AspNetCore.Mvc.Testing&version=10.0.0-preview.4.25258.110&prerelease
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'sbin
directory - Sets the content root to the SUT's project root so that static files are found during test execution
- Provides the
WebApplicationFactory
class 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:
xunit
xunit.runner.visualstudio
Microsoft.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.0-preview.4.25258.110)
- Microsoft.Extensions.DependencyModel (>= 10.0.0-preview.4.25258.110)
- Microsoft.Extensions.Hosting (>= 10.0.0-preview.4.25258.110)
NuGet packages (246)
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 |
|
Reo.Core.IntegrationTesting
Package Description |
|
FastEndpoints.Testing
Integration/End-To-End testing helper library for FastEndpoints |
GitHub repositories (307)
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 9
|
|
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 Preview 7, 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.
|
|
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.
|
|
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 8 and newer.
|
|
domaindrivendev/Swashbuckle.AspNetCore
Swagger tools for documenting API's built on ASP.NET Core
|
|
jasontaylordev/NorthwindTraders
Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
|
|
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
|
Version | Downloads | Last Updated | |
---|---|---|---|
10.0.0-preview.7.25380.108 | 11,666 | 8/12/2025 | |
10.0.0-preview.6.25358.103 | 3,261 | 7/15/2025 | |
10.0.0-preview.5.25277.114 | 5,490 | 6/6/2025 | |
10.0.0-preview.4.25258.110 | 4,941 | 5/12/2025 | |
10.0.0-preview.3.25172.1 | 3,380 | 4/10/2025 | |
10.0.0-preview.2.25164.1 | 2,844 | 3/18/2025 | |
10.0.0-preview.1.25120.3 | 71,792 | 2/25/2025 | |
9.0.8 | 718,904 | 8/5/2025 | |
9.0.7 | 625,448 | 7/8/2025 | |
9.0.6 | 925,659 | 6/10/2025 | |
9.0.5 | 1,095,135 | 5/13/2025 | |
9.0.4 | 1,553,775 | 4/8/2025 | |
9.0.3 | 1,345,055 | 3/11/2025 | |
9.0.2 | 1,343,916 | 2/11/2025 | |
9.0.1 | 1,372,112 | 1/14/2025 | |
9.0.0 | 2,650,749 | 11/12/2024 | |
9.0.0-rc.2.24474.3 | 47,299 | 10/8/2024 | |
9.0.0-rc.1.24452.1 | 24,744 | 9/10/2024 | |
9.0.0-preview.7.24406.2 | 8,226 | 8/13/2024 | |
9.0.0-preview.6.24328.4 | 11,586 | 7/9/2024 | |
9.0.0-preview.5.24306.11 | 3,632 | 6/11/2024 | |
9.0.0-preview.4.24267.6 | 2,690 | 5/21/2024 | |
9.0.0-preview.3.24172.13 | 70,514 | 4/11/2024 | |
9.0.0-preview.2.24128.4 | 4,376 | 3/12/2024 | |
9.0.0-preview.1.24081.5 | 25,793 | 2/13/2024 | |
8.0.19 | 476,382 | 8/4/2025 | |
8.0.18 | 383,928 | 7/8/2025 | |
8.0.17 | 861,922 | 6/10/2025 | |
8.0.16 | 829,043 | 5/13/2025 | |
8.0.15 | 1,434,782 | 4/8/2025 | |
8.0.14 | 1,535,179 | 3/11/2025 | |
8.0.13 | 1,768,761 | 2/11/2025 | |
8.0.12 | 1,709,520 | 1/14/2025 | |
8.0.11 | 4,711,650 | 11/12/2024 | |
8.0.10 | 6,407,513 | 10/8/2024 | |
8.0.8 | 7,402,637 | 8/13/2024 | |
8.0.7 | 5,329,829 | 7/9/2024 | |
8.0.6 | 4,562,310 | 5/28/2024 | |
8.0.5 | 2,145,742 | 5/14/2024 | |
8.0.4 | 5,250,720 | 4/9/2024 | |
8.0.3 | 3,448,022 | 3/12/2024 | |
8.0.2 | 3,239,238 | 2/13/2024 | |
8.0.1 | 3,634,154 | 1/9/2024 | |
8.0.0 | 5,227,246 | 11/14/2023 | |
8.0.0-rc.2.23480.2 | 58,006 | 10/10/2023 | |
8.0.0-rc.1.23421.29 | 56,347 | 9/12/2023 | |
8.0.0-preview.7.23375.9 | 10,826 | 8/8/2023 | |
8.0.0-preview.6.23329.11 | 28,060 | 7/11/2023 | |
8.0.0-preview.5.23302.2 | 12,855 | 6/13/2023 | |
8.0.0-preview.4.23260.4 | 260,970 | 5/16/2023 | |
8.0.0-preview.3.23177.8 | 3,586 | 4/11/2023 | |
8.0.0-preview.2.23153.2 | 2,105 | 3/14/2023 | |
8.0.0-preview.1.23112.2 | 41,038 | 2/21/2023 | |
7.0.20 | 507,393 | 5/28/2024 | |
7.0.19 | 79,091 | 5/14/2024 | |
7.0.18 | 186,321 | 4/9/2024 | |
7.0.17 | 384,731 | 3/12/2024 | |
7.0.16 | 414,672 | 2/13/2024 | |
7.0.15 | 561,720 | 1/9/2024 | |
7.0.14 | 960,486 | 11/14/2023 | |
7.0.13 | 2,032,024 | 10/24/2023 | |
7.0.12 | 722,609 | 10/10/2023 | |
7.0.11 | 3,127,473 | 9/12/2023 | |
7.0.10 | 1,416,489 | 8/8/2023 | |
7.0.9 | 1,238,384 | 7/11/2023 | |
7.0.8 | 909,068 | 6/22/2023 | |
7.0.7 | 484,374 | 6/13/2023 | |
7.0.5 | 2,961,668 | 4/11/2023 | |
7.0.4 | 1,646,950 | 3/14/2023 | |
7.0.3 | 1,506,691 | 2/14/2023 | |
7.0.2 | 1,501,452 | 1/10/2023 | |
7.0.1 | 867,209 | 12/13/2022 | |
7.0.0 | 2,807,275 | 11/7/2022 | |
7.0.0-rc.2.22476.2 | 67,160 | 10/11/2022 | |
7.0.0-rc.1.22427.2 | 22,412 | 9/14/2022 | |
7.0.0-preview.7.22376.6 | 7,830 | 8/9/2022 | |
7.0.0-preview.6.22330.3 | 2,504 | 7/12/2022 | |
7.0.0-preview.5.22303.8 | 9,439 | 6/14/2022 | |
7.0.0-preview.4.22251.1 | 2,216 | 5/10/2022 | |
7.0.0-preview.3.22178.4 | 1,313 | 4/13/2022 | |
7.0.0-preview.2.22153.2 | 1,073 | 3/14/2022 | |
7.0.0-preview.1.22109.13 | 5,153 | 2/17/2022 | |
6.0.36 | 1,100,872 | 11/12/2024 | |
6.0.35 | 215,511 | 10/8/2024 | |
6.0.33 | 1,086,193 | 8/13/2024 | |
6.0.32 | 300,326 | 7/9/2024 | |
6.0.31 | 448,543 | 5/28/2024 | |
6.0.30 | 155,561 | 5/14/2024 | |
6.0.29 | 676,327 | 4/9/2024 | |
6.0.28 | 409,650 | 3/12/2024 | |
6.0.27 | 612,918 | 2/13/2024 | |
6.0.26 | 886,288 | 1/9/2024 | |
6.0.25 | 1,616,758 | 11/14/2023 | |
6.0.24 | 825,585 | 10/24/2023 | |
6.0.23 | 584,462 | 10/10/2023 | |
6.0.22 | 944,466 | 9/12/2023 | |
6.0.21 | 1,326,986 | 8/8/2023 | |
6.0.20 | 1,224,218 | 7/11/2023 | |
6.0.19 | 738,213 | 6/22/2023 | |
6.0.18 | 490,179 | 6/13/2023 | |
6.0.16 | 2,517,479 | 4/11/2023 | |
6.0.15 | 1,388,747 | 3/14/2023 | |
6.0.14 | 1,746,471 | 2/14/2023 | |
6.0.13 | 2,265,736 | 1/10/2023 | |
6.0.12 | 2,482,749 | 12/13/2022 | |
6.0.11 | 2,782,683 | 11/7/2022 | |
6.0.10 | 4,220,573 | 10/11/2022 | |
6.0.9 | 3,214,441 | 9/13/2022 | |
6.0.8 | 4,126,126 | 8/9/2022 | |
6.0.7 | 3,475,771 | 7/12/2022 | |
6.0.6 | 2,567,935 | 6/14/2022 | |
6.0.5 | 3,170,245 | 5/10/2022 | |
6.0.4 | 2,935,943 | 4/11/2022 | |
6.0.3 | 3,146,527 | 3/8/2022 | |
6.0.2 | 3,059,943 | 2/8/2022 | |
6.0.1 | 4,439,254 | 12/14/2021 | |
6.0.0 | 5,101,586 | 11/8/2021 | |
6.0.0-rc.2.21480.10 | 205,623 | 10/12/2021 | |
6.0.0-rc.1.21452.15 | 173,263 | 9/14/2021 | |
6.0.0-preview.7.21378.6 | 7,420 | 8/10/2021 | |
6.0.0-preview.6.21355.2 | 4,484 | 7/14/2021 | |
6.0.0-preview.5.21301.17 | 3,266 | 6/15/2021 | |
6.0.0-preview.4.21253.5 | 6,645 | 5/24/2021 | |
6.0.0-preview.3.21201.13 | 4,993 | 4/8/2021 | |
6.0.0-preview.2.21154.6 | 969 | 3/11/2021 | |
6.0.0-preview.1.21103.6 | 1,066 | 2/12/2021 | |
5.0.17 | 712,730 | 5/10/2022 | |
5.0.16 | 111,202 | 4/11/2022 | |
5.0.15 | 216,116 | 3/8/2022 | |
5.0.14 | 211,967 | 2/8/2022 | |
5.0.13 | 504,722 | 12/14/2021 | |
5.0.12 | 610,185 | 11/7/2021 | |
5.0.11 | 1,050,469 | 10/12/2021 | |
5.0.10 | 1,068,421 | 9/14/2021 | |
5.0.9 | 1,185,413 | 8/10/2021 | |
5.0.8 | 932,152 | 7/13/2021 | |
5.0.7 | 1,207,154 | 6/8/2021 | |
5.0.6 | 953,157 | 5/11/2021 | |
5.0.5 | 1,389,870 | 4/6/2021 | |
5.0.4 | 833,389 | 3/9/2021 | |
5.0.3 | 997,381 | 2/9/2021 | |
5.0.2 | 946,273 | 1/12/2021 | |
5.0.1 | 587,630 | 12/8/2020 | |
5.0.0 | 1,703,393 | 11/9/2020 | |
5.0.0-rc.2.20475.17 | 15,059 | 10/13/2020 | |
5.0.0-rc.1.20451.17 | 9,172 | 9/14/2020 | |
5.0.0-preview.8.20414.8 | 9,271 | 8/25/2020 | |
5.0.0-preview.7.20365.19 | 3,799 | 7/21/2020 | |
5.0.0-preview.6.20312.15 | 2,157 | 6/25/2020 | |
5.0.0-preview.5.20279.2 | 987 | 6/10/2020 | |
5.0.0-preview.4.20257.10 | 1,618 | 5/18/2020 | |
5.0.0-preview.3.20215.14 | 2,092 | 4/23/2020 | |
5.0.0-preview.2.20167.3 | 985 | 4/2/2020 | |
5.0.0-preview.1.20124.5 | 1,229 | 3/16/2020 | |
3.1.32 | 479,656 | 12/13/2022 | |
3.1.31 | 98,578 | 11/8/2022 | |
3.1.30 | 785,447 | 10/11/2022 | |
3.1.29 | 73,489 | 9/13/2022 | |
3.1.28 | 118,771 | 8/9/2022 | |
3.1.27 | 110,754 | 7/12/2022 | |
3.1.26 | 126,255 | 6/14/2022 | |
3.1.25 | 142,378 | 5/10/2022 | |
3.1.24 | 143,342 | 4/11/2022 | |
3.1.23 | 207,968 | 3/8/2022 | |
3.1.22 | 606,138 | 12/14/2021 | |
3.1.21 | 442,483 | 11/7/2021 | |
3.1.20 | 399,543 | 10/11/2021 | |
3.1.19 | 274,299 | 9/14/2021 | |
3.1.18 | 808,292 | 8/10/2021 | |
3.1.17 | 572,255 | 7/13/2021 | |
3.1.16 | 498,604 | 6/8/2021 | |
3.1.15 | 445,292 | 5/11/2021 | |
3.1.14 | 781,716 | 4/6/2021 | |
3.1.13 | 915,414 | 3/9/2021 | |
3.1.12 | 555,594 | 2/9/2021 | |
3.1.11 | 710,873 | 1/12/2021 | |
3.1.10 | 2,165,761 | 11/9/2020 | |
3.1.9 | 2,341,589 | 10/13/2020 | |
3.1.8 | 2,048,728 | 9/8/2020 | |
3.1.7 | 1,591,399 | 8/11/2020 | |
3.1.6 | 1,787,146 | 7/14/2020 | |
3.1.5 | 2,154,382 | 6/9/2020 | |
3.1.4 | 1,514,808 | 5/12/2020 | |
3.1.3 | 2,434,194 | 3/24/2020 | |
3.1.2 | 2,013,321 | 2/18/2020 | |
3.1.1 | 1,805,258 | 1/14/2020 | |
3.1.0 | 2,160,462 | 12/3/2019 | |
3.1.0-preview3.19555.2 | 2,397 | 11/13/2019 | |
3.1.0-preview2.19528.8 | 1,166 | 11/1/2019 | |
3.1.0-preview1.19508.20 | 1,645 | 10/15/2019 | |
3.0.3 | 110,354 | 2/18/2020 | |
3.0.2 | 59,121 | 1/14/2020 | |
3.0.0 | 2,951,247 | 9/23/2019 | |
3.0.0-rc1.19457.4 | 10,696 | 9/16/2019 | |
3.0.0-preview9.19424.4 | 5,199 | 9/4/2019 | |
3.0.0-preview8.19405.7 | 16,247 | 8/13/2019 | |
3.0.0-preview7.19365.7 | 5,940 | 7/23/2019 | |
3.0.0-preview6.19307.2 | 4,730 | 6/12/2019 | |
3.0.0-preview5-19227-01 | 16,720 | 5/6/2019 | |
3.0.0-preview4-19216-03 | 2,150 | 4/18/2019 | |
3.0.0-preview3-19153-02 | 1,610 | 3/6/2019 | |
3.0.0-preview-19075-0444 | 3,815 | 1/29/2019 | |
3.0.0-preview-18579-0056 | 3,276 | 12/3/2018 | |
2.3.0 | 17,234 | 1/14/2025 | |
2.2.0 | 6,735,972 | 12/3/2018 | |
2.2.0-preview3-35497 | 16,237 | 10/17/2018 | |
2.2.0-preview2-35157 | 4,386 | 9/12/2018 | |
2.2.0-preview1-35029 | 7,468 | 8/22/2018 | |
2.1.3 | 1,497,917 | 10/1/2018 | |
2.1.2 | 364,567 | 8/21/2018 | |
2.1.1 | 1,002,130 | 6/18/2018 | |
2.1.0 | 886,175 | 5/29/2018 | |
2.1.0-rc1-final | 21,098 | 5/6/2018 | |
2.1.0-preview2-final | 5,118 | 4/10/2018 | |
2.1.0-preview1-final | 4,052 | 2/26/2018 |