.NET API
RetentionPolicyStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IRetentionPolicyStore contract.
public abstract class RetentionPolicyStoreContract : TenantIsolationContract<IRetentionPolicyStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IRetentionPolicyStore> ← RetentionPolicyStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IRetentionPolicyStore>.TenantA, TenantIsolationContract<IRetentionPolicyStore>.TenantB, TenantIsolationContract<IRetentionPolicyStore>.CreateStoreAsync(), TenantIsolationContract<IRetentionPolicyStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IRetentionPolicyStore>.InitializeAsync(), TenantIsolationContract<IRetentionPolicyStore>.DisposeAsync(), TenantIsolationContract<IRetentionPolicyStore>.OnDisposeAsync(), TenantIsolationContract<IRetentionPolicyStore>.SeedAsync(string, string), TenantIsolationContract<IRetentionPolicyStore>.ExistsAsync(string, object), TenantIsolationContract<IRetentionPolicyStore>.CountAsync(string), TenantIsolationContract<IRetentionPolicyStore>.TryDeleteAsync(string, object), TenantIsolationContract<IRetentionPolicyStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IRetentionPolicyStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IRetentionPolicyStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IRetentionPolicyStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IRetentionPolicyStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IRetentionPolicyStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IRetentionPolicyStore>.AmbientTenant, TenantIsolationContract<IRetentionPolicyStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”RetentionPolicyStoreContract()
Section titled “ RetentionPolicyStoreContract()”protected RetentionPolicyStoreContract()Methods
Section titled “Methods”Another_tenants_policy_is_not_visible()
Section titled “ Another_tenants_policy_is_not_visible()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 104)]public Task Another_tenants_policy_is_not_visible()Returns
Section titled “Returns”CountAsync(string)
Section titled “ CountAsync(string)”Reports how many records the given tenant sees through the listing endpoint.
protected override ValueTask<int> CountAsync(string tenantId)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
Returns
Section titled “Returns”The number of records seen.
Deleted_policy_is_not_read_back()
Section titled “ Deleted_policy_is_not_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 113)]public Task Deleted_policy_is_not_read_back()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_run_carries_the_error_message()
Section titled “ Failed_run_carries_the_error_message()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 140)]public Task Failed_run_carries_the_error_message()Returns
Section titled “Returns”Falls_back_to_the_wildcard_policy_when_no_tenant_specific_record_exists()
Section titled “ Falls_back_to_the_wildcard_policy_when_no_tenant_specific_record_exists()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 79)]public Task Falls_back_to_the_wildcard_policy_when_no_tenant_specific_record_exists()Returns
Section titled “Returns”Run_history_returns_newest_first()
Section titled “ Run_history_returns_newest_first()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 152)]public Task Run_history_returns_newest_first()Returns
Section titled “Returns”Run_is_created_and_progress_accumulates()
Section titled “ Run_is_created_and_progress_accumulates()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 122)]public Task Run_is_created_and_progress_accumulates()Returns
Section titled “Returns”Saved_policy_is_read_back()
Section titled “ Saved_policy_is_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 54)]public Task Saved_policy_is_read_back()Returns
Section titled “Returns”Saving_the_same_target_a_second_time_overwrites_it()
Section titled “ Saving_the_same_target_a_second_time_overwrites_it()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 67)]public Task Saving_the_same_target_a_second_time_overwrites_it()Returns
Section titled “Returns”SeedAsync(string, string)
Section titled “ SeedAsync(string, string)”Writes a sample record for the given tenant.
protected override ValueTask<object> SeedAsync(string tenantId, string name)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.
Returns
Section titled “Returns”The key to use for reading the record back.
Tenant_specific_record_takes_precedence_over_the_wildcard()
Section titled “ Tenant_specific_record_takes_precedence_over_the_wildcard()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionPolicyStoreContract.cs", 91)]public Task Tenant_specific_record_takes_precedence_over_the_wildcard()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.
TryOverwriteAsync(string, string)
Section titled “ TryOverwriteAsync(string, string)”Attempts to change the record’s content on behalf of the given tenant.
protected override ValueTask<bool> TryOverwriteAsync(string tenantId, string name)Parameters
Section titled “Parameters”tenantId string
The tenant attempting the update.
name string
The record’s name.
Returns
Section titled “Returns”true if the update was attempted; false if the store does not support this scenario.
Remarks
Section titled “Remarks”The default implementation calls TenantIsolationContract.SeedAsync a second time: writing a record with the same name verifies that two tenants can carry the same name independently.