.NET API
WorkflowDefinitionStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IWorkflowDefinitionStore contract.
public abstract class WorkflowDefinitionStoreContract : TenantIsolationContract<IWorkflowDefinitionStore>, IAsyncLifetime, IAsyncDisposable- Inheritance
- object ← StoreCancellationContract<IWorkflowDefinitionStore> ← TenantIsolationContract<IWorkflowDefinitionStore> ← WorkflowDefinitionStoreContract
- Implements
- IAsyncLifetime, IAsyncDisposable
- Inherited Members
- TenantIsolationContract<IWorkflowDefinitionStore>.TenantA, TenantIsolationContract<IWorkflowDefinitionStore>.TenantB, TenantIsolationContract<IWorkflowDefinitionStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IWorkflowDefinitionStore>.SeedAsync(string, string, CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.ExistsAsync(string, object), TenantIsolationContract<IWorkflowDefinitionStore>.CountAsync(string, CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.TryDeleteAsync(string, object), TenantIsolationContract<IWorkflowDefinitionStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IWorkflowDefinitionStore>.CancellableReadAsync(CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.CancellableWriteAsync(CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.WroteAnythingAsync(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IWorkflowDefinitionStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IWorkflowDefinitionStore>.AmbientTenant, StoreCancellationContract<IWorkflowDefinitionStore>.CreateStoreAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.InitializeAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.DisposeAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.OnDisposeAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.CancellableReadAsync(CancellationToken), StoreCancellationContract<IWorkflowDefinitionStore>.CancellableWriteAsync(CancellationToken), StoreCancellationContract<IWorkflowDefinitionStore>.WroteAnythingAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.Canceled_token_throws_on_read(), StoreCancellationContract<IWorkflowDefinitionStore>.The_write_this_contract_checks_can_be_read_back(), StoreCancellationContract<IWorkflowDefinitionStore>.Canceled_token_throws_on_write_and_leaves_no_trace(), StoreCancellationContract<IWorkflowDefinitionStore>.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 in-memory store and the SQL stores must pass the same scenarios. In particular, version increment, version history and tenant isolation must behave identically in all of them.
Constructors
Section titled “Constructors”WorkflowDefinitionStoreContract()
Section titled “ WorkflowDefinitionStoreContract()”protected WorkflowDefinitionStoreContract()Properties
Section titled “Properties”QualifiedWorkflowHistoryTable
Section titled “ QualifiedWorkflowHistoryTable”The fully qualified workflow_definition_versions table reference this provider’s raw SQL should use.
protected virtual string QualifiedWorkflowHistoryTable { get; }Property Value
Section titled “Property Value”RawNowExpression
Section titled “ RawNowExpression”The expression this provider’s raw SQL uses for “now” in a timestamp column.
protected virtual string RawNowExpression { get; }Property Value
Section titled “Property Value”SupportsRawHistory
Section titled “ SupportsRawHistory”Whether the backing state of this store can be reached with raw SQL (SQL providers only).
protected virtual bool SupportsRawHistory { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()
Section titled “ A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()”[Fact]public Task A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()Returns
Section titled “Returns”A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()
Section titled “ A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()”[Fact]public Task A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()Returns
Section titled “Returns”A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()
Section titled “ A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()”[Fact]public Task A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()Returns
Section titled “Returns”A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()
Section titled “ A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()”[Fact]public Task A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()Returns
Section titled “Returns”A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()
Section titled “ A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()”[Fact]public Task A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()Returns
Section titled “Returns”Agent_version_pins_survive_the_round_trip()
Section titled “ Agent_version_pins_survive_the_round_trip()”[Fact]public Task Agent_version_pins_survive_the_round_trip()Returns
Section titled “Returns”All_fields_survive_the_round_trip()
Section titled “ All_fields_survive_the_round_trip()”[Fact]public Task All_fields_survive_the_round_trip()Returns
Section titled “Returns”Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()
Section titled “ Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()”[Fact]public Task Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()Returns
Section titled “Returns”Another_tenants_definition_is_not_visible()
Section titled “ Another_tenants_definition_is_not_visible()”[Fact]public Task Another_tenants_definition_is_not_visible()Returns
Section titled “Returns”Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()
Section titled “ Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()”[Fact]public Task Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()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.
Deleted_definition_is_not_read_back()
Section titled “ Deleted_definition_is_not_read_back()”[Fact]public Task Deleted_definition_is_not_read_back()Returns
Section titled “Returns”Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()
Section titled “ Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()”[Fact]public Task Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()Returns
Section titled “Returns”Deleting_a_nonexistent_definition_returns_false()
Section titled “ Deleting_a_nonexistent_definition_returns_false()”[Fact]public Task Deleting_a_nonexistent_definition_returns_false()Returns
Section titled “Returns”Deleting_keeps_the_history_and_the_numbering_continues_after_it()
Section titled “ Deleting_keeps_the_history_and_the_numbering_continues_after_it()”[Fact]public Task Deleting_keeps_the_history_and_the_numbering_continues_after_it()Returns
Section titled “Returns”Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()
Section titled “ Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()”[Fact]public Task Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()Returns
Section titled “Returns”Every_save_increments_the_version()
Section titled “ Every_save_increments_the_version()”[Fact]public Task Every_save_increments_the_version()Returns
Section titled “Returns”Every_save_keeps_its_version_and_the_history_lists_them_newest_first()
Section titled “ Every_save_keeps_its_version_and_the_history_lists_them_newest_first()”[Fact]public Task Every_save_keeps_its_version_and_the_history_lists_them_newest_first()Returns
Section titled “Returns”ExecuteRawAsync(string)
Section titled “ ExecuteRawAsync(string)”Runs raw SQL against the backing store. Only called when WorkflowDefinitionStoreContract.SupportsRawHistory is true.
protected virtual ValueTask ExecuteRawAsync(string sql)Parameters
Section titled “Parameters”sql string
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.
Function_node_settings_survive_the_round_trip()
Section titled “ Function_node_settings_survive_the_round_trip()”[Fact]public Task Function_node_settings_survive_the_round_trip()Returns
Section titled “Returns”Incoming_version_value_is_ignored()
Section titled “ Incoming_version_value_is_ignored()”[Fact]public Task Incoming_version_value_is_ignored()Returns
Section titled “Returns”Listing_is_sorted_by_name()
Section titled “ Listing_is_sorted_by_name()”[Fact]public Task Listing_is_sorted_by_name()Returns
Section titled “Returns”Magentic_manager_name_is_preserved()
Section titled “ Magentic_manager_name_is_preserved()”[Fact]public Task Magentic_manager_name_is_preserved()Returns
Section titled “Returns”Node_list_survives_the_round_trip()
Section titled “ Node_list_survives_the_round_trip()”[Fact]public Task Node_list_survives_the_round_trip()Returns
Section titled “Returns”Node_timeouts_and_the_run_timeout_survive_the_round_trip()
Section titled “ Node_timeouts_and_the_run_timeout_survive_the_round_trip()”[Fact]public Task Node_timeouts_and_the_run_timeout_survive_the_round_trip()Returns
Section titled “Returns”Parameter_schema_survives_the_round_trip()
Section titled “ Parameter_schema_survives_the_round_trip()”[Fact]public Task Parameter_schema_survives_the_round_trip()Returns
Section titled “Returns”Same_name_is_independent_across_tenants()
Section titled “ Same_name_is_independent_across_tenants()”[Fact]public Task Same_name_is_independent_across_tenants()Returns
Section titled “Returns”Saved_definition_is_read_back()
Section titled “ Saved_definition_is_read_back()”[Fact]public Task Saved_definition_is_read_back()Returns
Section titled “Returns”Saving_again_without_node_settings_clears_them()
Section titled “ Saving_again_without_node_settings_clears_them()”[Fact]public Task Saving_again_without_node_settings_clears_them()Returns
Section titled “Returns”Saving_again_without_timeouts_clears_them()
Section titled “ Saving_again_without_timeouts_clears_them()”[Fact]public Task Saving_again_without_timeouts_clears_them()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.
The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()
Section titled “ The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()”[Fact]public Task The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()Returns
Section titled “Returns”The_request_timeout_survives_the_round_trip()
Section titled “ The_request_timeout_survives_the_round_trip()”[Fact]public Task The_request_timeout_survives_the_round_trip()Returns
Section titled “Returns”The_response_mode_survives_the_round_trip()
Section titled “ The_response_mode_survives_the_round_trip()”[Fact]public Task The_response_mode_survives_the_round_trip()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.