.NET API
SingletonLeaseStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the ISingletonLeaseStore contract.
public abstract class SingletonLeaseStoreContract : IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← SingletonLeaseStoreContract
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 lease-expiry test runs against real time (a short lease
plus a short wait): the SQL implementations do not take their clock from
an injectable TimeProvider – the same reason as
JobStoreContract.
There is no tenant concept here: single-executor election is a
deployment-wide concern. This is why the contract derives directly from
Xunit.IAsyncLifetime rather than from
Storage.TenantIsolationContract – the same pattern as
RetentionStoreContract.
Constructors
Section titled “Constructors”SingletonLeaseStoreContract()
Section titled “ SingletonLeaseStoreContract()”protected SingletonLeaseStoreContract()Properties
Section titled “Properties”The lease store under test.
protected ISingletonLeaseStore Store { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”CreateStoreAsync()
Section titled “ CreateStoreAsync()”Produces an empty lease store for the test.
protected abstract ValueTask<ISingletonLeaseStore> CreateStoreAsync()Returns
Section titled “Returns”ValueTask<ISingletonLeaseStore>
A store ready for use.
DisposeAsync()
Section titled “ DisposeAsync()”public ValueTask DisposeAsync()Returns
Section titled “Returns”Empty_lease_can_be_acquired()
Section titled “ Empty_lease_can_be_acquired()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 49)]public Task Empty_lease_can_be_acquired()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”OnDisposeAsync()
Section titled “ OnDisposeAsync()”Hook for a derived class to release its own resources.
protected virtual ValueTask OnDisposeAsync()Returns
Section titled “Returns”A completed task.
Owner_can_renew_its_lease()
Section titled “ Owner_can_renew_its_lease()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 88)]public Task Owner_can_renew_its_lease()Returns
Section titled “Returns”ReleaseAsync_by_a_non_owner_does_nothing()
Section titled “ ReleaseAsync_by_a_non_owner_does_nothing()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 135)]public Task ReleaseAsync_by_a_non_owner_does_nothing()Returns
Section titled “Returns”Released_lease_can_be_reacquired_immediately_by_someone_else()
Section titled “ Released_lease_can_be_reacquired_immediately_by_someone_else()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 123)]public Task Released_lease_can_be_reacquired_immediately_by_someone_else()Returns
Section titled “Returns”RenewAsync_returns_false_for_a_non_owner()
Section titled “ RenewAsync_returns_false_for_a_non_owner()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 115)]public Task RenewAsync_returns_false_for_a_non_owner()Returns
Section titled “Returns”RenewAsync_returns_false_once_the_lease_has_passed_to_someone_else()
Section titled “ RenewAsync_returns_false_once_the_lease_has_passed_to_someone_else()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 99)]public Task RenewAsync_returns_false_once_the_lease_has_passed_to_someone_else()Returns
Section titled “Returns”Same_owner_can_reacquire_its_own_lease()
Section titled “ Same_owner_can_reacquire_its_own_lease()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 66)]public Task Same_owner_can_reacquire_its_own_lease()Returns
Section titled “Returns”Second_owner_cannot_acquire_while_lease_is_held()
Section titled “ Second_owner_cannot_acquire_while_lease_is_held()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 57)]public Task Second_owner_cannot_acquire_while_lease_is_held()Returns
Section titled “Returns”Someone_else_can_acquire_once_the_lease_expires()
Section titled “ Someone_else_can_acquire_once_the_lease_expires()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SingletonLeaseStoreContract.cs", 77)]public Task Someone_else_can_acquire_once_the_lease_expires()