XBullet.EasyTesting.Testcontainers 1.0.8

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

XBullet.EasyTesting.Testcontainers

Scenario-scoped PostgreSQL, SQL Server, Kafka, Redis, RabbitMQ, Azurite, and Azure Service Bus emulator infrastructure powered by Testcontainers for .NET.

The package targets .NET 8, .NET 9, and .NET 10 and requires a Docker-compatible container runtime.

Install

dotnet add package XBullet.EasyTesting.Testcontainers

Built-in modules

using var factory = EasyTestHost.Create<Program>()
    .UsePostgreSql(options =>
    {
        options.ConfigurationKey = "ConnectionStrings:Orders";
        options.ConfigureBuilder(builder => builder
            .WithDatabase("orders")
            .WithUsername("orders_test"));
    })
    .UseRedis()
    .Build();

await using var scope = await factory.CreateTestScenarioScopeAsync();
var postgres = scope.GetTestcontainer<Program, PostgreSqlContainer>("PostgreSql");

Each module uses the native Testcontainers readiness strategy. The scenario application starts only after every container is ready and its mapped endpoint has been added to configuration. Containers are disposed in reverse registration order after the application host.

The default configuration keys are:

  • PostgreSQL: ConnectionStrings:PostgreSql
  • SQL Server: ConnectionStrings:SqlServer
  • Kafka: Kafka:BootstrapServers
  • Redis: ConnectionStrings:Redis
  • RabbitMQ: ConnectionStrings:RabbitMq
  • Azurite: ConnectionStrings:AzureStorage
  • Service Bus emulator: ConnectionStrings:ServiceBus

Service Bus requires explicit license acceptance:

builder.UseServiceBusEmulator(acceptLicenseAgreement: true);

Arbitrary containers

Use UseTestcontainer for a native or custom module. Resolve configuration values only after the container has started:

builder.UseTestcontainer(
    "search",
    _ => new ContainerBuilder("getmeili/meilisearch:v1.12.8")
        .WithPortBinding(7700, assignRandomHostPort: true)
        .WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(
            request => request.ForPort(7700).ForPath("/health")))
        .Build(),
    container => new Dictionary<string, string?>
    {
        ["Search:Endpoint"] = $"http://{container.Hostname}:{container.GetMappedPublicPort(7700)}"
    },
    configureServices: null,
    maximumDiagnosticCharacters: 20_000);

Failure diagnostics contain container identity, image, state, health, mapped ports, and bounded stdout/stderr. Published configuration values are intentionally excluded because connection strings can contain credentials.

Runtime verification

The repository keeps real-service tests explicit so an ordinary unit-test run does not require Docker. Run the complete PostgreSQL, SQL Server, Kafka, Redis, RabbitMQ, Azurite, and Service Bus suite with:

dotnet test tests/XBullet.EasyTesting.ContainerTests/XBullet.EasyTesting.ContainerTests.csproj \
  --configuration Release --explicit only

These slow tests are intentionally excluded from CI and are available for local or manually scheduled infrastructure verification.

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
1.0.8 59 9/21/2026
1.0.7 47 9/19/2026
1.0.6 48 9/18/2026
1.0.5 46 9/18/2026
1.0.4 52 9/15/2026