Skip to content
Tracon

JobScheduleStoreContract

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

Behavior tests for the IJobScheduleStore contract.

public abstract class JobScheduleStoreContract : TenantIsolationContract<IJobScheduleStore>, IAsyncLifetime, IAsyncDisposable

objectTenantIsolationContract<IJobScheduleStore>JobScheduleStoreContract

IAsyncLifetime, IAsyncDisposable

TenantIsolationContract<IJobScheduleStore>.TenantA, TenantIsolationContract<IJobScheduleStore>.TenantB, TenantIsolationContract<IJobScheduleStore>.CreateStoreAsync(), TenantIsolationContract<IJobScheduleStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IJobScheduleStore>.InitializeAsync(), TenantIsolationContract<IJobScheduleStore>.DisposeAsync(), TenantIsolationContract<IJobScheduleStore>.OnDisposeAsync(), TenantIsolationContract<IJobScheduleStore>.SeedAsync(string, string), TenantIsolationContract<IJobScheduleStore>.ExistsAsync(string, object), TenantIsolationContract<IJobScheduleStore>.CountAsync(string), TenantIsolationContract<IJobScheduleStore>.TryDeleteAsync(string, object), TenantIsolationContract<IJobScheduleStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IJobScheduleStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IJobScheduleStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IJobScheduleStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IJobScheduleStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IJobScheduleStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IJobScheduleStore>.AmbientTenant, TenantIsolationContract<IJobScheduleStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

protected JobScheduleStoreContract()

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

protected override ValueTask<int> CountAsync(string tenantId)

tenantId string

The reading tenant.

ValueTask<int>

The number of records seen.

DeleteAsync_removes_an_existing_schedule()

Section titled “ DeleteAsync_removes_an_existing_schedule()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 54)]
public Task DeleteAsync_removes_an_existing_schedule()

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.

GetAsync_returns_null_for_another_tenant()

Section titled “ GetAsync_returns_null_for_another_tenant()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 46)]
public Task GetAsync_returns_null_for_another_tenant()

Task

[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 63)]
public Task ListAsync_returns_only_that_tenant()

Task

ListDueAsync_returns_only_enabled_and_due_schedules()

Section titled “ ListDueAsync_returns_only_enabled_and_due_schedules()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 75)]
public Task ListDueAsync_returns_only_enabled_and_due_schedules()

Task

SaveAsync_assigns_an_id_to_a_new_schedule()

Section titled “ SaveAsync_assigns_an_id_to_a_new_schedule()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 26)]
public Task SaveAsync_assigns_an_id_to_a_new_schedule()

Task

SaveAsync_keeps_the_id_and_updates_for_the_same_name()

Section titled “ SaveAsync_keeps_the_id_and_updates_for_the_same_name()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 34)]
public Task SaveAsync_keeps_the_id_and_updates_for_the_same_name()

Task

Writes a sample record for the given tenant.

protected override ValueTask<object> SeedAsync(string tenantId, string name)

tenantId string

The tenant that owns the record.

name string

The name distinguishing the record. The same name may be used by two tenants.

ValueTask<object>

The key to use for reading the record back.

TryClaimNextRunAsync_a_second_claim_prevents_the_conflict()

Section titled “ TryClaimNextRunAsync_a_second_claim_prevents_the_conflict()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 102)]
public Task TryClaimNextRunAsync_a_second_claim_prevents_the_conflict()

Task

TryClaimNextRunAsync_fails_when_the_expected_value_does_not_match()

Section titled “ TryClaimNextRunAsync_fails_when_the_expected_value_does_not_match()”
[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/JobScheduleStoreContract.cs", 90)]
public Task TryClaimNextRunAsync_fails_when_the_expected_value_does_not_match()

Task

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.