.NET API
RetentionStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior and tenant isolation tests for the IRetentionStore data plane.
public abstract class RetentionStoreContract : IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← RetentionStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”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 guards against a security defect: a data plane with no tenant filter, where one tenant’s retention policy could delete all tenants’ rows.
The contract does not derive from Storage.TenantIsolationContract: the data plane has no concept of a “record” (there is no write side), seeding goes through the target table’s own store. Isolation is tested directly here.
Constructors
Section titled “Constructors”RetentionStoreContract()
Section titled “ RetentionStoreContract()”protected RetentionStoreContract()Fields
Section titled “Fields”TenantA
Section titled “ TenantA”The tenant that writes the data.
protected const string TenantA = "tenant-a"Field Value
Section titled “Field Value”TenantB
Section titled “ TenantB”The tenant whose data must be preserved.
protected const string TenantB = "tenant-b"Field Value
Section titled “Field Value”Properties
Section titled “Properties”The data plane under test.
protected IRetentionStore Store { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Archive_read_returns_only_the_given_tenant()
Section titled “ Archive_read_returns_only_the_given_tenant()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionStoreContract.cs", 89)]public Task Archive_read_returns_only_the_given_tenant()Returns
Section titled “Returns”Count_covers_only_the_given_tenant()
Section titled “ Count_covers_only_the_given_tenant()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionStoreContract.cs", 60)]public Task Count_covers_only_the_given_tenant()Returns
Section titled “Returns”CreateStoreAsync()
Section titled “ CreateStoreAsync()”Produces an empty data plane for testing.
protected abstract ValueTask<IRetentionStore> CreateStoreAsync()Returns
Section titled “Returns”A store ready for use.
Delete_does_NOT_touch_the_others_data()
Section titled “ Delete_does_NOT_touch_the_others_data()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionStoreContract.cs", 73)]public Task Delete_does_NOT_touch_the_others_data()Returns
Section titled “Returns”DisposeAsync()
Section titled “ DisposeAsync()”public ValueTask DisposeAsync()Returns
Section titled “Returns”InitializeAsync()
Section titled “ InitializeAsync()”Called immediately after the class has been created, before it is used.
public ValueTask InitializeAsync()Returns
Section titled “Returns”OnDisposeAsync()
Section titled “ OnDisposeAsync()”Hook for the derived class to release its own resources.
protected virtual ValueTask OnDisposeAsync()Returns
Section titled “Returns”The completion task.
Row_limit_threshold_counts_only_the_given_tenant()
Section titled “ Row_limit_threshold_counts_only_the_given_tenant()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionStoreContract.cs", 104)]public Task Row_limit_threshold_counts_only_the_given_tenant()Returns
Section titled “Returns”SeedOldRowAsync(string)
Section titled “ SeedOldRowAsync(string)”Writes a row for the given tenant, older than the cutoff date, that falls under the RetentionTargets.VoiceSessions target.
protected abstract ValueTask SeedOldRowAsync(string tenantId)Parameters
Section titled “Parameters”tenantId string
The tenant that owns the row.
Returns
Section titled “Returns”The completion task.
Unknown_target_throws()
Section titled “ Unknown_target_throws()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/RetentionStoreContract.cs", 119)]public Task Unknown_target_throws()