Skip to content
Tracon

InboundTriggerStoreContract

Namespace Tracon.Testing.Contracts.Storage · Assembly Tracon.Testing.Contracts.Xunit.dll

Behavior tests for the IInboundTriggerStore contract.

public abstract class InboundTriggerStoreContract : TenantIsolationContract<IInboundTriggerStore>, IAsyncLifetime, IAsyncDisposable
Inheritance
object ← StoreCancellationContract<IInboundTriggerStore> ← TenantIsolationContract<IInboundTriggerStore> ← InboundTriggerStoreContract
Implements
IAsyncLifetime, IAsyncDisposable
Inherited Members
TenantIsolationContract<IInboundTriggerStore>.TenantA, TenantIsolationContract<IInboundTriggerStore>.TenantB, TenantIsolationContract<IInboundTriggerStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IInboundTriggerStore>.SeedAsync(string, string, CancellationToken), TenantIsolationContract<IInboundTriggerStore>.ExistsAsync(string, object), TenantIsolationContract<IInboundTriggerStore>.CountAsync(string, CancellationToken), TenantIsolationContract<IInboundTriggerStore>.TryDeleteAsync(string, object), TenantIsolationContract<IInboundTriggerStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IInboundTriggerStore>.CancellableReadAsync(CancellationToken), TenantIsolationContract<IInboundTriggerStore>.CancellableWriteAsync(CancellationToken), TenantIsolationContract<IInboundTriggerStore>.WroteAnythingAsync(), TenantIsolationContract<IInboundTriggerStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IInboundTriggerStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IInboundTriggerStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IInboundTriggerStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IInboundTriggerStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IInboundTriggerStore>.AmbientTenant, StoreCancellationContract<IInboundTriggerStore>.CreateStoreAsync(), StoreCancellationContract<IInboundTriggerStore>.InitializeAsync(), StoreCancellationContract<IInboundTriggerStore>.DisposeAsync(), StoreCancellationContract<IInboundTriggerStore>.OnDisposeAsync(), StoreCancellationContract<IInboundTriggerStore>.CancellableReadAsync(CancellationToken), StoreCancellationContract<IInboundTriggerStore>.CancellableWriteAsync(CancellationToken), StoreCancellationContract<IInboundTriggerStore>.WroteAnythingAsync(), StoreCancellationContract<IInboundTriggerStore>.Canceled_token_throws_on_read(), StoreCancellationContract<IInboundTriggerStore>.The_write_this_contract_checks_can_be_read_back(), StoreCancellationContract<IInboundTriggerStore>.Canceled_token_throws_on_write_and_leaves_no_trace(), StoreCancellationContract<IInboundTriggerStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This contract never asserts a signing secret VALUE: the store carries only the configuration key’s NAME. It exists to prove tenant isolation and round-tripping of the trigger definition.

protected InboundTriggerStoreContract()

Reports how many records the given tenant sees through the listing endpoint.

protected override ValueTask<int> CountAsync(string tenantId, CancellationToken cancellationToken)

tenantId string

The reading tenant.

cancellationToken CancellationToken

The token every store call inside the hook must be handed; see TenantIsolationContract.SeedAsync.

ValueTask<int>

The number of records seen.

DeleteAsync_returns_false_for_a_trigger_that_does_not_exist()

Section titled “ DeleteAsync_returns_false_for_a_trigger_that_does_not_exist()”
[Fact]
public Task DeleteAsync_returns_false_for_a_trigger_that_does_not_exist()

Task

Reports whether the record is visible from the given tenant’s viewpoint.

protected override ValueTask<bool> ExistsAsync(string tenantId, object key)

tenantId string

The reading tenant.

key object

The key returned by TenantIsolationContract.SeedAsync.

ValueTask<bool>

true if the record is visible.

Listing_returns_every_trigger_of_the_tenant()

Section titled “ Listing_returns_every_trigger_of_the_tenant()”
[Fact]
public Task Listing_returns_every_trigger_of_the_tenant()

Task

[Fact]
public Task Missing_trigger_returns_null()

Task

[Fact]
public Task Path_mode_and_path_round_trip()

Task

[Fact]
public Task Saved_trigger_is_read_back()

Task

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)

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.

ValueTask<object>

The key to use for reading the record back.

Attempts to delete the record on behalf of the given tenant.

protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)

tenantId string

The tenant attempting the delete.

key object

The key returned by TenantIsolationContract.SeedAsync.

ValueTask<bool?>

true if the delete succeeded, false if the record was not found; null if the store does not offer deletion.

Upsert_replaces_the_existing_trigger_for_the_same_tenant_and_name()

Section titled “ Upsert_replaces_the_existing_trigger_for_the_same_tenant_and_name()”
[Fact]
public Task Upsert_replaces_the_existing_trigger_for_the_same_tenant_and_name()

Task

[Fact]
public Task Workflow_target_kind_round_trips()

Task