Trellis.Testing.Idempotency 3.0.0-alpha.574

This is a prerelease version of Trellis.Testing.Idempotency.
dotnet add package Trellis.Testing.Idempotency --version 3.0.0-alpha.574
                    
NuGet\Install-Package Trellis.Testing.Idempotency -Version 3.0.0-alpha.574
                    
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.574" />
                    
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.574" />
                    
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.574
                    
#r "nuget: Trellis.Testing.Idempotency, 3.0.0-alpha.574"
                    
#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.574
                    
#: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.574&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Trellis.Testing.Idempotency&version=3.0.0-alpha.574&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

Use xunit.v3 4.0.1 or later in the consuming test project (Microsoft.Testing.Platform 2). The conformance library itself references only xunit.v3.extensibility.core, not the runner.

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, empty keys, 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. The separate Trellis.Asp.Idempotency.Cosmos package supplies a distributed production store via AddCosmosIdempotencyStore; applications using Redis, a relational database, or another backend can implement their own. 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 18 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 comparison — ShouldMatch avoids the reference-equality trap in IdempotencyResponseSnapshot that would fail every serialising store

Documentation

See the package 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.574 55 10/14/2026
3.0.0-alpha.571 44 10/13/2026
3.0.0-alpha.557 48 10/8/2026
3.0.0-alpha.554 46 10/8/2026
3.0.0-alpha.553 42 10/7/2026
3.0.0-alpha.542 50 10/5/2026
3.0.0-alpha.539 52 10/4/2026
3.0.0-alpha.532 65 10/2/2026
3.0.0-alpha.527 54 10/1/2026
3.0.0-alpha.526 57 9/30/2026
3.0.0-alpha.524 72 9/27/2026
3.0.0-alpha.520 65 9/25/2026
3.0.0-alpha.516 153 9/22/2026
3.0.0-alpha.513 59 9/22/2026
3.0.0-alpha.505 78 9/13/2026
3.0.0-alpha.495 131 8/24/2026
3.0.0-alpha.458 108 8/19/2026
3.0.0-alpha.455 148 8/19/2026
3.0.0-alpha.449 79 8/18/2026
3.0.0-alpha.447 84 8/18/2026