Skip to content
Tracon

IdempotencyStoreContract

Namespace Tracon.Testing.Contracts.Storage · Assembly Tracon.Testing.Contracts.Xunit.dll

Behavior tests for the IIdempotencyStore contract.

public abstract class IdempotencyStoreContract : IAsyncLifetime, IAsyncDisposable

objectIdempotencyStoreContract

IAsyncLifetime, IAsyncDisposable

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The in-memory store and the three SQL providers must pass the same scenarios.

The tenant id is passed explicitly to every call (not through the ambient ITenantContext) — the contract therefore does not rely on the generic CRUD shape of TenantIsolationContract<TStore>, but directly on Xunit.IAsyncLifetime; the same pattern as SingletonLeaseStoreContract.

protected IdempotencyStoreContract()

The idempotency store under test.

protected IIdempotencyStore Store { get; }

IIdempotencyStore

Completed_key_also_returns_the_stored_HTTP_headers()

Section titled “ Completed_key_also_returns_the_stored_HTTP_headers()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 101)]
public Task Completed_key_also_returns_the_stored_HTTP_headers()

Task

Completed_key_returns_an_empty_dictionary_when_there_are_NO_headers()

Section titled “ Completed_key_returns_an_empty_dictionary_when_there_are_NO_headers()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 121)]
public Task Completed_key_returns_an_empty_dictionary_when_there_are_NO_headers()

Task

Completed_key_returns_the_stored_response_with_the_same_fingerprint()

Section titled “ Completed_key_returns_the_stored_response_with_the_same_fingerprint()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 85)]
public Task Completed_key_returns_the_stored_response_with_the_same_fingerprint()

Task

Completed_key_with_a_DIFFERENT_fingerprint_returns_FingerprintMismatch()

Section titled “ Completed_key_with_a_DIFFERENT_fingerprint_returns_FingerprintMismatch()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 134)]
public Task Completed_key_with_a_DIFFERENT_fingerprint_returns_FingerprintMismatch()

Task

Completed_record_does_NOT_affect_another_tenant()

Section titled “ Completed_record_does_NOT_affect_another_tenant()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 176)]
public Task Completed_record_does_NOT_affect_another_tenant()

Task

Concurrent_reservation_of_the_same_key_only_one_gets_Reserved()

Section titled “ Concurrent_reservation_of_the_same_key_only_one_gets_Reserved()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 189)]
public Task Concurrent_reservation_of_the_same_key_only_one_gets_Reserved()

Task

Produces an empty idempotency store for testing.

protected abstract ValueTask<IIdempotencyStore> CreateStoreAsync()

ValueTask<IIdempotencyStore>

A store ready for use.

public ValueTask DisposeAsync()

ValueTask

Called immediately after the class has been created, before it is used.

public ValueTask InitializeAsync()

ValueTask

Key_in_progress_returns_InProgress_on_second_reservation()

Section titled “ Key_in_progress_returns_InProgress_on_second_reservation()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 73)]
public Task Key_in_progress_returns_InProgress_on_second_reservation()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 64)]
public Task New_key_returns_Reserved()

Task

Hook for the derived class to release its own resources.

protected virtual ValueTask OnDisposeAsync()

ValueTask

The completion task.

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 148)]
public Task Released_key_can_be_reserved_again()

Task

Same_key_lives_independently_in_two_tenants()

Section titled “ Same_key_lives_independently_in_two_tenants()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 163)]
public Task Same_key_lives_independently_in_two_tenants()

Task