.NET API
WebhookStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IWebhookStore contract.
public abstract class WebhookStoreContract : TenantIsolationContract<IWebhookStore>, IAsyncLifetime, IAsyncDisposable- Inheritance
- object ← StoreCancellationContract<IWebhookStore> ← TenantIsolationContract<IWebhookStore> ← WebhookStoreContract
- Implements
- IAsyncLifetime, IAsyncDisposable
- Inherited Members
- TenantIsolationContract<IWebhookStore>.TenantA, TenantIsolationContract<IWebhookStore>.TenantB, TenantIsolationContract<IWebhookStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IWebhookStore>.SeedAsync(string, string, CancellationToken), TenantIsolationContract<IWebhookStore>.ExistsAsync(string, object), TenantIsolationContract<IWebhookStore>.CountAsync(string, CancellationToken), TenantIsolationContract<IWebhookStore>.TryDeleteAsync(string, object), TenantIsolationContract<IWebhookStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IWebhookStore>.CancellableReadAsync(CancellationToken), TenantIsolationContract<IWebhookStore>.CancellableWriteAsync(CancellationToken), TenantIsolationContract<IWebhookStore>.WroteAnythingAsync(), TenantIsolationContract<IWebhookStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IWebhookStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IWebhookStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IWebhookStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IWebhookStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IWebhookStore>.AmbientTenant, StoreCancellationContract<IWebhookStore>.CreateStoreAsync(), StoreCancellationContract<IWebhookStore>.InitializeAsync(), StoreCancellationContract<IWebhookStore>.DisposeAsync(), StoreCancellationContract<IWebhookStore>.OnDisposeAsync(), StoreCancellationContract<IWebhookStore>.CancellableReadAsync(CancellationToken), StoreCancellationContract<IWebhookStore>.CancellableWriteAsync(CancellationToken), StoreCancellationContract<IWebhookStore>.WroteAnythingAsync(), StoreCancellationContract<IWebhookStore>.Canceled_token_throws_on_read(), StoreCancellationContract<IWebhookStore>.The_write_this_contract_checks_can_be_read_back(), StoreCancellationContract<IWebhookStore>.Canceled_token_throws_on_write_and_leaves_no_trace(), StoreCancellationContract<IWebhookStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”This contract has no secret field. The store only carries the name of the configuration key the secret is read from; tests verify this.
Constructors
Section titled “Constructors”WebhookStoreContract()
Section titled “ WebhookStoreContract()”protected WebhookStoreContract()Methods
Section titled “Methods”Another_tenants_subscription_is_not_visible()
Section titled “ Another_tenants_subscription_is_not_visible()”[Fact]public Task Another_tenants_subscription_is_not_visible()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_subscription_is_not_read_back()
Section titled “ Deleted_subscription_is_not_read_back()”[Fact]public Task Deleted_subscription_is_not_read_back()Returns
Section titled “Returns”Deleting_a_subscription_also_deletes_its_deliveries()
Section titled “ Deleting_a_subscription_also_deletes_its_deliveries()”[Fact]public Task Deleting_a_subscription_also_deletes_its_deliveries()Returns
Section titled “Returns”Deliveries_are_filtered_by_status()
Section titled “ Deliveries_are_filtered_by_status()”[Fact]public Task Deliveries_are_filtered_by_status()Returns
Section titled “Returns”Delivery_record_is_read_back()
Section titled “ Delivery_record_is_read_back()”[Fact]public Task Delivery_record_is_read_back()Returns
Section titled “Returns”Disabled_subscription_does_not_appear_in_event_search()
Section titled “ Disabled_subscription_does_not_appear_in_event_search()”[Fact]public Task Disabled_subscription_does_not_appear_in_event_search()Returns
Section titled “Returns”Event_name_matches_exactly()
Section titled “ Event_name_matches_exactly()”[Fact]public Task Event_name_matches_exactly()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.
Failed_delivery_does_not_record_a_delivery_time()
Section titled “ Failed_delivery_does_not_record_a_delivery_time()”[Fact]public Task Failed_delivery_does_not_record_a_delivery_time()Returns
Section titled “Returns”Failure_counter_increments_and_disables_the_subscription_at_the_threshold()
Section titled “ Failure_counter_increments_and_disables_the_subscription_at_the_threshold()”[Fact]public Task Failure_counter_increments_and_disables_the_subscription_at_the_threshold()Returns
Section titled “Returns”Header_configuration_keys_are_preserved()
Section titled “ Header_configuration_keys_are_preserved()”[Fact]public Task Header_configuration_keys_are_preserved()Returns
Section titled “Returns”Header_names_that_differ_only_in_case_do_not_fail_the_save()
Section titled “ Header_names_that_differ_only_in_case_do_not_fail_the_save()”[Fact]public Task Header_names_that_differ_only_in_case_do_not_fail_the_save()Returns
Section titled “Returns”Headers_are_preserved()
Section titled “ Headers_are_preserved()”[Fact]public Task Headers_are_preserved()Returns
Section titled “Returns”Saved_subscription_is_read_back()
Section titled “ Saved_subscription_is_read_back()”[Fact]public Task Saved_subscription_is_read_back()Returns
Section titled “Returns”Saving_a_subscription_again_writes_the_failure_counter_it_carries()
Section titled “ Saving_a_subscription_again_writes_the_failure_counter_it_carries()”[Fact]public Task Saving_a_subscription_again_writes_the_failure_counter_it_carries()Returns
Section titled “Returns”Saving_the_same_name_a_second_time_overwrites_it()
Section titled “ Saving_the_same_name_a_second_time_overwrites_it()”[Fact]public Task Saving_the_same_name_a_second_time_overwrites_it()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.
Subscribers_for_an_event_are_found()
Section titled “ Subscribers_for_an_event_are_found()”[Fact]public Task Subscribers_for_an_event_are_found()Returns
Section titled “Returns”Successful_delivery_resets_the_counter()
Section titled “ Successful_delivery_resets_the_counter()”[Fact]public Task Successful_delivery_resets_the_counter()Returns
Section titled “Returns”Successful_delivery_result_is_recorded()
Section titled “ Successful_delivery_result_is_recorded()”[Fact]public Task Successful_delivery_result_is_recorded()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.