Trellis.Testing.Idempotency
3.0.0-alpha.449
dotnet add package Trellis.Testing.Idempotency --version 3.0.0-alpha.449
NuGet\Install-Package Trellis.Testing.Idempotency -Version 3.0.0-alpha.449
<PackageReference Include="Trellis.Testing.Idempotency" Version="3.0.0-alpha.449" />
<PackageVersion Include="Trellis.Testing.Idempotency" Version="3.0.0-alpha.449" />
<PackageReference Include="Trellis.Testing.Idempotency" />
paket add Trellis.Testing.Idempotency --version 3.0.0-alpha.449
#r "nuget: Trellis.Testing.Idempotency, 3.0.0-alpha.449"
#:package Trellis.Testing.Idempotency@3.0.0-alpha.449
#addin nuget:?package=Trellis.Testing.Idempotency&version=3.0.0-alpha.449&prerelease
#tool nuget:?package=Trellis.Testing.Idempotency&version=3.0.0-alpha.449&prerelease
Trellis.Testing.Idempotency
Executable conformance suite for Trellis IIdempotencyStore implementations.
Installation
dotnet add package Trellis.Testing.Idempotency
Quick Example
using Trellis.Testing.Idempotency;
public sealed class RedisIdempotencyStoreConformanceTests : IdempotencyStoreConformance
{
// Redis enforces expiry server-side, so use short real timeouts.
protected override TimeSpan ReservationTimeout => TimeSpan.FromSeconds(2);
protected override TimeSpan Ttl => TimeSpan.FromSeconds(4);
protected override ValueTask<IIdempotencyStore> CreateStoreAsync(IdempotencyOptions options) =>
new(new RedisIdempotencyStore(_multiplexer, options));
}
That one class runs the full contract: reserve, replay, fingerprint mismatch, reservation takeover, TTL expiry, abandon semantics, and atomicity under concurrent load.
Why
Trellis.Asp ships only InMemoryIdempotencyStore, which is not safe across instances or process
restarts, so production deployments write their own over Redis, Cosmos DB, or a database. A
violation of the contract fails silently — a non-atomic reserve lets two racing callers both
execute the handler, and an unconditional AbandonAsync destroys a response CompleteAsync
already persisted. Nothing throws. The symptom is a customer charged twice.
Key Features
- One class per store — implement
CreateStoreAsyncand inherit 17 contract tests - Works with fake or real clocks — override
AdvanceAsyncforTimeProvider-based stores, or shortenTtl/ReservationTimeoutwhen a remote server owns expiry - Safe against shared infrastructure — each test instance gets a unique
Scope, so suites can run in parallel against one Redis or Cosmos DB instance - Structural snapshot comparison —
ShouldMatchavoids the reference-equality trap inIdempotencyResponseSnapshotthat would fail every serialising store
Documentation
See the API reference for the full rule list and the implementation traps the suite catches.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- FluentAssertions (>= 7.2.2)
- Microsoft.Extensions.DependencyModel (>= 10.0.10)
- OpenTelemetry.Api (>= 1.17.0)
- Trellis.Asp (>= 3.0.0-alpha.449)
- xunit.v3.extensibility.core (>= 3.2.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 |
|---|---|---|
| 3.0.0-alpha.449 | 8 | 8/18/2026 |
| 3.0.0-alpha.447 | 36 | 8/18/2026 |