.NET API
IdempotencyStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IIdempotencyStore contract.
public abstract class IdempotencyStoreContract : IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← IdempotencyStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”IdempotencyStoreContract()
Section titled “ IdempotencyStoreContract()”protected IdempotencyStoreContract()Properties
Section titled “Properties”The idempotency store under test.
protected IIdempotencyStore Store { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”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()Returns
Section titled “Returns”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()Returns
Section titled “Returns”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()Returns
Section titled “Returns”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()Returns
Section titled “Returns”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()Returns
Section titled “Returns”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()Returns
Section titled “Returns”CreateStoreAsync()
Section titled “ CreateStoreAsync()”Produces an empty idempotency store for testing.
protected abstract ValueTask<IIdempotencyStore> CreateStoreAsync()Returns
Section titled “Returns”A store ready for use.
DisposeAsync()
Section titled “ DisposeAsync()”public ValueTask DisposeAsync()Returns
Section titled “Returns”InitializeAsync()
Section titled “ InitializeAsync()”Called immediately after the class has been created, before it is used.
public ValueTask InitializeAsync()Returns
Section titled “Returns”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()Returns
Section titled “Returns”New_key_returns_Reserved()
Section titled “ New_key_returns_Reserved()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 64)]public Task New_key_returns_Reserved()Returns
Section titled “Returns”OnDisposeAsync()
Section titled “ OnDisposeAsync()”Hook for the derived class to release its own resources.
protected virtual ValueTask OnDisposeAsync()Returns
Section titled “Returns”The completion task.
Released_key_can_be_reserved_again()
Section titled “ Released_key_can_be_reserved_again()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/IdempotencyStoreContract.cs", 148)]public Task Released_key_can_be_reserved_again()Returns
Section titled “Returns”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()