Soenneker.Fixtures.Integration 11.0.831

Prefix Reserved
dotnet add package Soenneker.Fixtures.Integration --version 11.0.831
                    
NuGet\Install-Package Soenneker.Fixtures.Integration -Version 11.0.831
                    
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="Soenneker.Fixtures.Integration" Version="11.0.831" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Fixtures.Integration" Version="11.0.831" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Fixtures.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 Soenneker.Fixtures.Integration --version 11.0.831
                    
#r "nuget: Soenneker.Fixtures.Integration, 11.0.831"
                    
#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 Soenneker.Fixtures.Integration@11.0.831
                    
#: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=Soenneker.Fixtures.Integration&version=11.0.831
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Fixtures.Integration&version=11.0.831
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Fixtures.Integration

A reusable xUnit fixture for lazily creating multiple authenticated ASP.NET Core WebApplicationFactory<T> instances with test logging and Bogus data generation.

Installation

dotnet add package Soenneker.Fixtures.Integration

Define a fixture

public sealed class ApiFixture : IntegrationFixture
{
    public ApiFixture()
    {
        RegisterFactory<Program>("net10.0");
    }
}

[CollectionDefinition("API")]
public sealed class ApiCollection : ICollectionFixture<ApiFixture>;

projectName identifies the directory directly beneath the parent of AppContext.BaseDirectory that contains appsettings.json. For a typical test output at bin/Debug/net10.0, passing net10.0 loads the copied bin/Debug/net10.0/appsettings.json. The resolved path must stay beneath that parent directory.

Register each startup type once. Repeated concurrent registrations for the same TStartup are safe; the first project name wins.

Use a factory

[Collection("API")]
public sealed class AccountTests(ApiFixture fixture)
{
    [Fact]
    public async Task Gets_account()
    {
        WebApplicationFactory<Program> factory = fixture.GetFactory<Program>().Value;
        using HttpClient client = factory.CreateClient();

        HttpResponseMessage response = await client.GetAsync("/api/account");
        response.EnsureSuccessStatusCode();
    }
}

Factories are lazy: registration does not start an application, and fixture disposal skips factories that were never created. Asking for an unregistered startup type throws InvalidOperationException.

Test host behavior

Each created factory:

  • Adds the selected appsettings.json without file watching.
  • Registers the JWT utility and integration-test startup filter.
  • Sets the default authentication scheme to Test and installs TestAuthHandler.
  • Sends verbose Serilog events to the injectable xUnit output sink.

The test authentication handler is for in-memory integration hosts only. Do not copy it into production service registration. Verbose test logs can contain application data, so avoid real credentials and production personal data in test configuration and requests.

Generated data

After xUnit calls InitializeAsync(), Faker and AutoFaker are available. A derived fixture can assign AutoFakerConfig before initialization to customize generation. Factory instances and generated-data helpers are shared according to the xUnit fixture lifetime, so tests should not mutate shared configuration after use begins.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.831 0 11/19/2026
11.0.830 0 11/19/2026
11.0.829 0 11/18/2026
11.0.828 8 11/18/2026
11.0.826 13 11/18/2026
11.0.823 43 11/18/2026
11.0.822 50 11/18/2026
11.0.821 59 11/15/2026
11.0.820 64 11/14/2026
11.0.819 106 11/11/2026
11.0.818 88 11/11/2026
11.0.817 98 11/11/2026
11.0.816 96 11/11/2026
11.0.815 94 11/11/2026
11.0.813 86 11/11/2026
11.0.812 94 11/11/2026
11.0.810 88 11/11/2026
11.0.809 89 11/11/2026
11.0.808 97 11/11/2026
11.0.807 90 11/11/2026
Loading failed

Updated Multiple NuGet packages