.NET API
PendingApprovalStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IPendingApprovalStore contract.
public abstract class PendingApprovalStoreContract : TenantIsolationContract<IPendingApprovalStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IPendingApprovalStore> ← PendingApprovalStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IPendingApprovalStore>.TenantA, TenantIsolationContract<IPendingApprovalStore>.TenantB, TenantIsolationContract<IPendingApprovalStore>.CreateStoreAsync(), TenantIsolationContract<IPendingApprovalStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IPendingApprovalStore>.InitializeAsync(), TenantIsolationContract<IPendingApprovalStore>.DisposeAsync(), TenantIsolationContract<IPendingApprovalStore>.OnDisposeAsync(), TenantIsolationContract<IPendingApprovalStore>.SeedAsync(string, string), TenantIsolationContract<IPendingApprovalStore>.ExistsAsync(string, object), TenantIsolationContract<IPendingApprovalStore>.CountAsync(string), TenantIsolationContract<IPendingApprovalStore>.TryDeleteAsync(string, object), TenantIsolationContract<IPendingApprovalStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IPendingApprovalStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IPendingApprovalStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IPendingApprovalStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IPendingApprovalStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IPendingApprovalStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IPendingApprovalStore>.AmbientTenant, TenantIsolationContract<IPendingApprovalStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”A pending approval request is a security record: one tenant’s operator cannot see, and must not be able to decide, another tenant’s approval. The PendingApprovalStoreContract.TryDeleteAsync hook is wired to the mutation operation here — IPendingApprovalStore.DecideAsync — its meaning is “decide”, not “delete”, but the two-way isolation check needs the same shape.
Constructors
Section titled “Constructors”PendingApprovalStoreContract()
Section titled “ PendingApprovalStoreContract()”protected PendingApprovalStoreContract()Methods
Section titled “Methods”Absent_presentation_is_read_back_as_null()
Section titled “ Absent_presentation_is_read_back_as_null()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 109)]public Task Absent_presentation_is_read_back_as_null()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.
Created_request_is_read_back()
Section titled “ Created_request_is_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 64)]public Task Created_request_is_read_back()Returns
Section titled “Returns”Deciding_updates_status_and_actor()
Section titled “ Deciding_updates_status_and_actor()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 140)]public Task Deciding_updates_status_and_actor()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.
Expired_request_is_closed_and_returned()
Section titled “ Expired_request_is_closed_and_returned()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 176)]public Task Expired_request_is_closed_and_returned()Returns
Section titled “Returns”Expiry_scan_does_not_exceed_the_max_limit()
Section titled “ Expiry_scan_does_not_exceed_the_max_limit()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 195)]public Task Expiry_scan_does_not_exceed_the_max_limit()Returns
Section titled “Returns”Listing_returns_only_pending_requests()
Section titled “ Listing_returns_only_pending_requests()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 123)]public Task Listing_returns_only_pending_requests()Returns
Section titled “Returns”PrepareRunAsync(Guid, string)
Section titled “ PrepareRunAsync(Guid, string)”Opens a run row at the given id before an approval request is written.
protected virtual ValueTask PrepareRunAsync(Guid runId, string tenantId)Parameters
Section titled “Parameters”runId Guid
The run id.
tenantId string
The tenant id.
Returns
Section titled “Returns”The completion task.
Remarks
Section titled “Remarks”In the SQL implementations, pending_approvals.run_id is a
foreign key into the runs table (the SAME pattern as
RunInputStoreContract.PrepareRunAsync); the in-memory
implementation has no such link, and the hook does nothing.
Presentation_round_trips_through_create_and_get()
Section titled “ Presentation_round_trips_through_create_and_get()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 81)]public Task Presentation_round_trips_through_create_and_get()Returns
Section titled “Returns”Second_decision_is_rejected()
Section titled “ Second_decision_is_rejected()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/PendingApprovalStoreContract.cs", 161)]public Task Second_decision_is_rejected()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.
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.