ResQ.BuildingBlocks.Testing.Integration
0.2.0
dotnet add package ResQ.BuildingBlocks.Testing.Integration --version 0.2.0
NuGet\Install-Package ResQ.BuildingBlocks.Testing.Integration -Version 0.2.0
<PackageReference Include="ResQ.BuildingBlocks.Testing.Integration" Version="0.2.0" />
<PackageVersion Include="ResQ.BuildingBlocks.Testing.Integration" Version="0.2.0" />
<PackageReference Include="ResQ.BuildingBlocks.Testing.Integration" />
paket add ResQ.BuildingBlocks.Testing.Integration --version 0.2.0
#r "nuget: ResQ.BuildingBlocks.Testing.Integration, 0.2.0"
#:package ResQ.BuildingBlocks.Testing.Integration@0.2.0
#addin nuget:?package=ResQ.BuildingBlocks.Testing.Integration&version=0.2.0
#tool nuget:?package=ResQ.BuildingBlocks.Testing.Integration&version=0.2.0
ResQ.BuildingBlocks.Testing.Integration
Docker-backed integration-test helpers for the ResQ building blocks. Kept separate from
ResQ.BuildingBlocks.Testing so that
unit-only consumers never drag in Docker or the ASP.NET Core test host.
Targets net9.0 only (matches Microsoft.AspNetCore.Mvc.Testing 9.0.0, whose assets are net9-only).
Carries a FrameworkReference on Microsoft.AspNetCore.App and depends on
ResQ.BuildingBlocks.Testing + Application + Domain.
What's in the box
| Type | Role |
|---|---|
PostgresContainerFixture |
Starts a throwaway PostgreSQL container (Testcontainers) for a collection |
DatabaseCollection |
xUnit [CollectionDefinition("database")] sharing one container |
ResqWebApplicationFactory<TEntryPoint> |
WebApplicationFactory with a ConfigureTestServices hook |
Requirements
A running Docker daemon. PostgresContainerFixture.InitializeAsync() throws when Docker is
unavailable, so gate these tests in CI — for example tag them [Trait("Category","Integration")]
and run dotnet test --filter Category=Integration only on a Docker-enabled job.
Quick start
using ResQ.BuildingBlocks.Testing.Integration;
using Xunit;
[Collection("database")]
public sealed class WidgetApiTests
{
private readonly PostgresContainerFixture _db;
public WidgetApiTests(PostgresContainerFixture db) => _db = db;
[Fact]
[Trait("Category", "Integration")]
public async Task Creates_a_widget()
{
await using var factory = new ApiFactory(_db.ConnectionString);
using var client = factory.CreateClient();
var response = await client.PostAsJsonAsync("/api/v1/widgets", new { name = "gadget" });
response.EnsureSuccessStatusCode();
}
}
// Point the app under test at the container database.
internal sealed class ApiFactory(string connectionString) : ResqWebApplicationFactory<Program>
{
protected override void ConfigureTestServices(IServiceCollection services)
{
// e.g. replace the production DbContext options with `connectionString`
}
}
License
Apache-2.0. See LICENSE.
| Product | Versions 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. |
-
net9.0
- FluentAssertions (>= 6.12.2)
- FluentValidation (>= 11.11.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
- Microsoft.AspNetCore.Mvc.Testing (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- NSubstitute (>= 5.3.0)
- ResQ.BuildingBlocks.Application (>= 0.2.0)
- ResQ.BuildingBlocks.Domain (>= 0.2.0)
- ResQ.BuildingBlocks.Testing (>= 0.2.0)
- Scrutor (>= 5.0.1)
- Testcontainers (>= 4.0.0)
- Testcontainers.PostgreSql (>= 4.0.0)
- xunit (>= 2.9.2)
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.2.0 | 182 | 8/16/2026 |