Skip to content
Tracon

VoiceSessionStoreContract

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

Behavior tests for the IVoiceSessionStore contract.

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

The in-memory store and the three SQL providers must pass the same scenarios. Two rules are critical: a second write with the same ID updates the record (a call is first opened, then closed), and input_seconds does not lose its decimal fraction.

protected VoiceSessionStoreContract()
[Fact]
public Task Agent_and_session_filters_work()

Task

[Fact]
public Task Another_tenants_record_is_not_visible()

Task

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.

Duration_does_NOT_lose_its_decimal_fraction()

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

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.

[Fact]
public Task List_is_ordered_newest_to_oldest()

Task

Live_session_provider_model_and_cost_round_trip()

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

Task

Missing_measurement_stays_null_NOT_zero()

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

Task

[Fact]
public Task Paging_is_applied()

Task

[Fact]
public Task Saved_call_is_read_back()

Task

Second_write_with_the_same_id_UPDATES_the_record()

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

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.

[Fact]
public Task The_two_new_end_reasons_round_trip()

Task

Unpriced_live_session_reads_back_with_a_null_cost_NOT_a_zero()

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

Task