Soenneker.Tests.Integration 11.0.1066

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

A TUnit base class for HTTP and service-level tests over a shared WebApplicationFactory supplied by IntegrationTestHost.

Installation

dotnet add package Soenneker.Tests.Integration

Define the host

using Soenneker.TestHosts.Integration;

public sealed class Host : IntegrationTestHost
{
    public override Task InitializeAsync()
    {
        RegisterFactory<Api.Program>("Api");
        return base.InitializeAsync();
    }
}

The project name identifies the appsettings location expected by IntegrationTestHost. See that package's README for the output-directory convention.

Define the tests

using Soenneker.Tests.Integration;

[ClassDataSource<Host>(Shared = SharedType.PerTestSession)]
public sealed class OrdersApiTests : IntegrationTest<Api.Program>
{
    public OrdersApiTests(Host host) : base(host)
    {
    }

    [Test]
    public async Task Gets_orders()
    {
        using HttpResponseMessage response = await Client.GetAsync("/orders");

        await Assert.That(response.IsSuccessStatusCode).IsTrue();
    }
}

Client is created lazily and disposed with the test instance. It uses the test authentication scheme with ClientUserId and ClientEmail; it does not add an admin role. Use Factory.CreateTestHttpClient(...) directly when a test needs another identity, roles, or a JWT.

Resolving services

OrderRepository repository = Resolve<OrderRepository>(scoped: true);

Resolve<T>() uses the application's root provider. Resolve<T>(scoped: true) creates one async scope per test instance, reuses it, and disposes it during teardown. Factory is owned by the shared host and must not be disposed by individual tests.

Background work and static resolution

WaitOnQueueToEmpty(cancellationToken) polls the application's IQueueInformationUtil every 500 milliseconds until processing stops. Supply a bounded cancellation token; the default token allows an unhealthy queue to wait indefinitely.

StaticResolve<T>() targets the most recently constructed IntegrationTest<TEntryPoint> instance. Avoid it in parallel tests because another instance of the same generic test base can replace the static target; prefer the instance Resolve<T>() method.

The base class reuses the host's Faker and AutoFaker, and resolves logging through the test's application scope.

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.1066 72 11/4/2026
11.0.1065 79 11/4/2026
11.0.1064 79 11/3/2026
11.0.1063 83 11/3/2026
11.0.1062 77 11/3/2026
11.0.1061 75 11/3/2026
11.0.1060 81 11/3/2026
11.0.1059 86 11/3/2026
11.0.1058 87 11/2/2026
11.0.1057 85 11/2/2026
11.0.1056 101 10/29/2026
11.0.1055 108 10/27/2026
11.0.1054 94 10/27/2026
11.0.1053 100 10/27/2026
11.0.1052 95 10/26/2026
11.0.1051 99 10/26/2026
11.0.1049 96 10/26/2026
11.0.1048 98 10/26/2026
11.0.1047 93 10/26/2026
11.0.1046 92 10/26/2026
Loading failed

Updated Multiple NuGet packages