.NET API
RunInputStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IRunInputStore contract.
public abstract class RunInputStoreContract : IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← RunInputStoreContract
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”Every implementation must pass the same scenarios.
The most valuable test is
RunInputStoreContract.Polymorphic_content_round_trips_with_KEY_ORDER_preserved:
a store that reorders object keys on write (for example, one backed by a
JSON-typed column) can silently move the $type discriminator away
from the first property, and the read then fails with a
JsonException. Neither the build nor the other tests catch this.
Constructors
Section titled “Constructors”RunInputStoreContract()
Section titled “ RunInputStoreContract()”protected RunInputStoreContract()Properties
Section titled “Properties”The input store under test.
protected IRunInputStore Store { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Another_tenants_input_cannot_be_read()
Section titled “ Another_tenants_input_cannot_be_read()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RunInputStoreContract.cs", 134)]public Task Another_tenants_input_cannot_be_read()Returns
Section titled “Returns”CreateStoreAsync()
Section titled “ CreateStoreAsync()”Produces an empty input store for testing.
protected abstract ValueTask<IRunInputStore> 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”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.
Polymorphic_content_round_trips_with_KEY_ORDER_preserved()
Section titled “ Polymorphic_content_round_trips_with_KEY_ORDER_preserved()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RunInputStoreContract.cs", 95)]public Task Polymorphic_content_round_trips_with_KEY_ORDER_preserved()Returns
Section titled “Returns”PrepareRunAsync(Guid, string)
Section titled “ PrepareRunAsync(Guid, string)”Opens a run row at the given id before an input is written.
protected virtual ValueTask PrepareRunAsync(Guid runId, string tenantId)Parameters
Section titled “Parameters”runId Guid
The run id.
tenantId string
The tenant id.
Returns
Section titled “Returns”The completion task.
Remarks
Section titled “Remarks”In the SQL implementations, run_inputs.run_id is a foreign key
into the runs table; the in-memory implementation has no such
link, and the hook does nothing.
Run_without_a_record_returns_null()
Section titled “ Run_without_a_record_returns_null()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RunInputStoreContract.cs", 76)]public Task Run_without_a_record_returns_null()Returns
Section titled “Returns”Second_write_is_IGNORED()
Section titled “ Second_write_is_IGNORED()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RunInputStoreContract.cs", 80)]public Task Second_write_is_IGNORED()Returns
Section titled “Returns”Written_input_round_trips_exactly()
Section titled “ Written_input_round_trips_exactly()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RunInputStoreContract.cs", 59)]public Task Written_input_round_trips_exactly()