XUnit3Helper.Integration 0.0.4-alpha

This is a prerelease version of XUnit3Helper.Integration.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package XUnit3Helper.Integration --version 0.0.4-alpha
                    
NuGet\Install-Package XUnit3Helper.Integration -Version 0.0.4-alpha
                    
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="XUnit3Helper.Integration" Version="0.0.4-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XUnit3Helper.Integration" Version="0.0.4-alpha" />
                    
Directory.Packages.props
<PackageReference Include="XUnit3Helper.Integration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XUnit3Helper.Integration --version 0.0.4-alpha
                    
#r "nuget: XUnit3Helper.Integration, 0.0.4-alpha"
                    
#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.
#:package XUnit3Helper.Integration@0.0.4-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XUnit3Helper.Integration&version=0.0.4-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=XUnit3Helper.Integration&version=0.0.4-alpha&prerelease
                    
Install as a Cake Tool

XUnit3Helper.Integration

en ru

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

  1. Create a factory by inheriting from BaseWebApplicationFactory<TYourStartupModule>:
    • implement ServerKey (Guid), ControllersAssembly (Assembly), and override Environment and ServiceTypeForMock if needed.
  2. Implement TYourStartupModule : BaseStartupModule with a constructor (IWebHostEnvironment, ConfigurationManager).
  3. In your test, inherit from BaseControllerTests<TYourStartupModule, TYourFactory> or use the factory/fixture manually and call CreateClient().

Important: CreateStartupModule creates the startup module instance using reflection — ensure your startup module contains a constructor with the required signature.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 140 10/30/2025