Trellis.Testing.Idempotency 3.0.0-alpha.449

This is a prerelease version of Trellis.Testing.Idempotency.
dotnet add package Trellis.Testing.Idempotency --version 3.0.0-alpha.449
                    
NuGet\Install-Package Trellis.Testing.Idempotency -Version 3.0.0-alpha.449
                    
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="Trellis.Testing.Idempotency" Version="3.0.0-alpha.449" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trellis.Testing.Idempotency" Version="3.0.0-alpha.449" />
                    
Directory.Packages.props
<PackageReference Include="Trellis.Testing.Idempotency" />
                    
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 Trellis.Testing.Idempotency --version 3.0.0-alpha.449
                    
#r "nuget: Trellis.Testing.Idempotency, 3.0.0-alpha.449"
                    
#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 Trellis.Testing.Idempotency@3.0.0-alpha.449
                    
#: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=Trellis.Testing.Idempotency&version=3.0.0-alpha.449&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Trellis.Testing.Idempotency&version=3.0.0-alpha.449&prerelease
                    
Install as a Cake Tool

Trellis.Testing.Idempotency

NuGet Package

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 CreateStoreAsync and inherit 17 contract tests
  • Works with fake or real clocks — override AdvanceAsync for TimeProvider-based stores, or shorten Ttl/ReservationTimeout when 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 comparisonShouldMatch avoids the reference-equality trap in IdempotencyResponseSnapshot that would fail every serialising store

Documentation

See the API reference for the full rule list and the implementation traps the suite catches.

Product 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. 
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
3.0.0-alpha.449 8 8/18/2026
3.0.0-alpha.447 36 8/18/2026