XUnit3Helper.Integration
0.0.5-alpha
dotnet add package XUnit3Helper.Integration --version 0.0.5-alpha
NuGet\Install-Package XUnit3Helper.Integration -Version 0.0.5-alpha
<PackageReference Include="XUnit3Helper.Integration" Version="0.0.5-alpha" />
<PackageVersion Include="XUnit3Helper.Integration" Version="0.0.5-alpha" />
<PackageReference Include="XUnit3Helper.Integration" />
paket add XUnit3Helper.Integration --version 0.0.5-alpha
#r "nuget: XUnit3Helper.Integration, 0.0.5-alpha"
#:package XUnit3Helper.Integration@0.0.5-alpha
#addin nuget:?package=XUnit3Helper.Integration&version=0.0.5-alpha&prerelease
#tool nuget:?package=XUnit3Helper.Integration&version=0.0.5-alpha&prerelease
XUnit3Helper.Integration
A short guide on using helper utilities for integration testing ASP.NET Core applications.
Overview
The XUnit3Helper.Integration project provides primitives to run a test WebApplication with a real Kestrel server and conveniences for controller testing:
- Test application factory with Kestrel —
BaseWebApplicationFactory, - Base class for controller tests —
BaseControllerTests.
The goal is to simplify starting a test application on a random free port, injecting startup modules, and registering controllers from a specific assembly.
Usage
- Create a factory by inheriting from
BaseWebApplicationFactory<TYourStartupModule>:- implement
ServerKey(Guid),ControllersAssembly(Assembly), and overrideEnvironmentandServiceTypeForMockif needed.
- implement
- Implement
TYourStartupModule : BaseStartupModulewith a constructor(IWebHostEnvironment, ConfigurationManager). - In your test, inherit from
BaseControllerTests<TYourStartupModule, TYourFactory>or use the factory/fixture manually and callCreateClient().
Important: CreateStartupModule creates the startup module instance using reflection — ensure your startup module contains a constructor with the required signature.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Serilog.Extensions.Hosting (>= 9.0.1-dev-02307)
- Serilog.Sinks.Console (>= 6.1.1)
- XUnit3Helper (>= 0.0.5-alpha)
- XUnit3Helper.StartupModule (>= 0.0.5-alpha)
-
net8.0
- Serilog.Extensions.Hosting (>= 9.0.1-dev-02307)
- Serilog.Sinks.Console (>= 6.1.1)
- XUnit3Helper (>= 0.0.5-alpha)
- XUnit3Helper.StartupModule (>= 0.0.5-alpha)
-
net9.0
- Serilog.Extensions.Hosting (>= 9.0.1-dev-02307)
- Serilog.Sinks.Console (>= 6.1.1)
- XUnit3Helper (>= 0.0.5-alpha)
- XUnit3Helper.StartupModule (>= 0.0.5-alpha)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.5-alpha | 265 | 11/13/2025 |
| 0.0.4-alpha | 104 | 11/8/2025 |
| 0.0.3-alpha | 141 | 10/30/2025 |