.NET API
WorkflowCheckpointStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IWorkflowCheckpointStore contract.
public abstract class WorkflowCheckpointStoreContract : TenantIsolationContract<IWorkflowCheckpointStore>, IAsyncLifetime, IAsyncDisposable- Inheritance
- object ← StoreCancellationContract<IWorkflowCheckpointStore> ← TenantIsolationContract<IWorkflowCheckpointStore> ← WorkflowCheckpointStoreContract
- Implements
- IAsyncLifetime, IAsyncDisposable
- Inherited Members
- TenantIsolationContract<IWorkflowCheckpointStore>.TenantA, TenantIsolationContract<IWorkflowCheckpointStore>.TenantB, TenantIsolationContract<IWorkflowCheckpointStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IWorkflowCheckpointStore>.SeedAsync(string, string, CancellationToken), TenantIsolationContract<IWorkflowCheckpointStore>.ExistsAsync(string, object), TenantIsolationContract<IWorkflowCheckpointStore>.CountAsync(string, CancellationToken), TenantIsolationContract<IWorkflowCheckpointStore>.TryDeleteAsync(string, object), TenantIsolationContract<IWorkflowCheckpointStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IWorkflowCheckpointStore>.CancellableReadAsync(CancellationToken), TenantIsolationContract<IWorkflowCheckpointStore>.CancellableWriteAsync(CancellationToken), TenantIsolationContract<IWorkflowCheckpointStore>.WroteAnythingAsync(), TenantIsolationContract<IWorkflowCheckpointStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IWorkflowCheckpointStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IWorkflowCheckpointStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IWorkflowCheckpointStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IWorkflowCheckpointStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IWorkflowCheckpointStore>.AmbientTenant, StoreCancellationContract<IWorkflowCheckpointStore>.CreateStoreAsync(), StoreCancellationContract<IWorkflowCheckpointStore>.InitializeAsync(), StoreCancellationContract<IWorkflowCheckpointStore>.DisposeAsync(), StoreCancellationContract<IWorkflowCheckpointStore>.OnDisposeAsync(), StoreCancellationContract<IWorkflowCheckpointStore>.CancellableReadAsync(CancellationToken), StoreCancellationContract<IWorkflowCheckpointStore>.CancellableWriteAsync(CancellationToken), StoreCancellationContract<IWorkflowCheckpointStore>.WroteAnythingAsync(), StoreCancellationContract<IWorkflowCheckpointStore>.Canceled_token_throws_on_read(), StoreCancellationContract<IWorkflowCheckpointStore>.The_write_this_contract_checks_can_be_read_back(), StoreCancellationContract<IWorkflowCheckpointStore>.Canceled_token_throws_on_write_and_leaves_no_trace(), StoreCancellationContract<IWorkflowCheckpointStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The most critical scenario is reading back a polymorphic payload
without corruption: the Microsoft Agent Framework checkpoint JSON
carries a $type discriminator that must be the first property of
the object it appears in. A store that reorders object keys on write can
silently take the discriminator out of first place, so a compliant
implementation must preserve key order.
Constructors
Section titled “Constructors”WorkflowCheckpointStoreContract()
Section titled “ WorkflowCheckpointStoreContract()”protected WorkflowCheckpointStoreContract()Methods
Section titled “Methods”A_checkpoint_written_without_version_stamps_lists_back_null()
Section titled “ A_checkpoint_written_without_version_stamps_lists_back_null()”[Fact]public Task A_checkpoint_written_without_version_stamps_lists_back_null()Returns
Section titled “Returns”Another_tenants_checkpoint_is_NOT_FOUND()
Section titled “ Another_tenants_checkpoint_is_NOT_FOUND()”[Fact]public Task Another_tenants_checkpoint_is_NOT_FOUND()Returns
Section titled “Returns”CountAsync(string, CancellationToken)
Section titled “ CountAsync(string, CancellationToken)”Reports how many records the given tenant sees through the listing endpoint.
protected override ValueTask<int> CountAsync(string tenantId, CancellationToken cancellationToken)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
cancellationToken CancellationToken
The token every store call inside the hook must be handed; see TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”The number of records seen.
Delete_clears_the_entire_session()
Section titled “ Delete_clears_the_entire_session()”[Fact]public Task Delete_clears_the_entire_session()Returns
Section titled “Returns”ExistsAsync(string, object)
Section titled “ ExistsAsync(string, object)”Reports whether the record is visible from the given tenant’s viewpoint.
protected override ValueTask<bool> ExistsAsync(string tenantId, object key)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
key object
The key returned by TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”true if the record is visible.
Listing_by_run_filters_correctly()
Section titled “ Listing_by_run_filters_correctly()”[Fact]public Task Listing_by_run_filters_correctly()Returns
Section titled “Returns”Listing_does_NOT_CARRY_the_state_payload()
Section titled “ Listing_does_NOT_CARRY_the_state_payload()”[Fact]public Task Listing_does_NOT_CARRY_the_state_payload()Returns
Section titled “Returns”Listing_preserves_creation_order()
Section titled “ Listing_preserves_creation_order()”[Fact]public Task Listing_preserves_creation_order()Returns
Section titled “Returns”Nonexistent_checkpoint_returns_null()
Section titled “ Nonexistent_checkpoint_returns_null()”[Fact]public Task Nonexistent_checkpoint_returns_null()Returns
Section titled “Returns”Polymorphic_payload_is_read_back_with_KEY_ORDER_PRESERVED()
Section titled “ Polymorphic_payload_is_read_back_with_KEY_ORDER_PRESERVED()”[Fact]public Task Polymorphic_payload_is_read_back_with_KEY_ORDER_PRESERVED()Returns
Section titled “Returns”SeedAsync(string, string, CancellationToken)
Section titled “ SeedAsync(string, string, CancellationToken)”Writes a sample record for the given tenant.
protected override ValueTask<object> SeedAsync(string tenantId, string name, CancellationToken cancellationToken)Parameters
Section titled “Parameters”tenantId string
The tenant that owns the record.
name string
The name distinguishing the record. The same name may be used by two tenants.
cancellationToken CancellationToken
The token every store call inside the hook must be handed. The cancellation contract calls this hook with a token that is already cancelled, so a hook that drops the token reports a store as sound when it is not.
Returns
Section titled “Returns”The key to use for reading the record back.
StateSchemaVersion_and_StateMafVersion_round_trip_through_listing_metadata()
Section titled “ StateSchemaVersion_and_StateMafVersion_round_trip_through_listing_metadata()”[Fact]public Task StateSchemaVersion_and_StateMafVersion_round_trip_through_listing_metadata()Returns
Section titled “Returns”TryDeleteAsync(string, object)
Section titled “ TryDeleteAsync(string, object)”Attempts to delete the record on behalf of the given tenant.
protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)Parameters
Section titled “Parameters”tenantId string
The tenant attempting the delete.
key object
The key returned by TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”true if the delete succeeded, false if the record was not found; null if the store does not offer deletion.
Written_checkpoint_is_read_back()
Section titled “ Written_checkpoint_is_read_back()”[Fact]public Task Written_checkpoint_is_read_back()Returns
Section titled “Returns”WroteAnythingAsync()
Section titled “ WroteAnythingAsync()”Reports whether StoreCancellationContract.CancellableWriteAsync left anything behind.
protected override ValueTask<bool> WroteAnythingAsync()Returns
Section titled “Returns”true if the store holds any record the write would have created.