Reusable.XunitV3.TestContainers 0.0.1

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

TestContainers.Xunit.Reusable

A test fixture for xUnit V3 supporting reusable containers.

This is a drop-in replacement for TestContainers.XunitV3.

Installation

dotnet add package Reusable.XunitV3.TestContainers

https://www.nuget.org/packages/Reusable.XunitV3.TestContainers/

Getting Started

This library has the same functionality as TestContainers.XunitV3 but also supports test runner parallelism when using reusable containers. To enable the reuse feature, set the TESTCONTAINERS_REUSE_ENABLE environment variable to true or override the Reuse property of ContainerFixture. The fixture will use the Docker API to guarantee idempotency when the reusable container is created, i.e. only one container with the current set of labels will be created no matter how many test runners start the fixture at the same time. It does so by using the reuse hash as the container name.

You can read more here: https://github.com/testcontainers/testcontainers-dotnet/issues/1482

Reusable Container Fixture

public sealed class HelloWorldContainerFixture(IMessageSink sink)
    : ContainerFixture<HelloWorldContainerBuilder, HelloWorldContainer>(sink)
{
    protected override bool Reuse => true;    
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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.1 165 8/27/2025
0.0.1-pre-74b0c998 157 8/27/2025
0.0.1-pre-52e96b1a 161 8/27/2025

## v0.0.1 (2025-08-27)