Soenneker.Fixtures.Integration 11.0.783

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Fixtures.Integration --version 11.0.783
                    
NuGet\Install-Package Soenneker.Fixtures.Integration -Version 11.0.783
                    
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.783" />
                    
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.783" />
                    
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.783
                    
#r "nuget: Soenneker.Fixtures.Integration, 11.0.783"
                    
#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.783
                    
#: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.783
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Fixtures.Integration&version=11.0.783
                    
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.794 60 10/27/2026
11.0.793 52 10/27/2026
11.0.792 50 10/27/2026
11.0.791 54 10/27/2026
11.0.790 61 10/27/2026
11.0.789 59 10/26/2026
11.0.785 57 10/26/2026
11.0.784 57 10/26/2026
11.0.783 56 10/26/2026
11.0.782 63 10/26/2026
11.0.781 60 10/26/2026
11.0.779 65 10/26/2026
4.0.776 94 10/25/2026
4.0.774 114 10/15/2026
4.0.773 95 10/15/2026
4.0.772 82 10/15/2026
4.0.770 88 10/15/2026
4.0.769 93 10/14/2026
4.0.768 100 10/14/2026
4.0.765 102 10/14/2026
Loading failed

Update dependency Soenneker.StartupFilters.IntegrationTests to v11 (#1326)