.NET API
ToolApprovalRuleStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IToolApprovalRuleStore contract.
public abstract class ToolApprovalRuleStoreContract : TenantIsolationContract<IToolApprovalRuleStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IToolApprovalRuleStore> ← ToolApprovalRuleStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IToolApprovalRuleStore>.TenantA, TenantIsolationContract<IToolApprovalRuleStore>.TenantB, TenantIsolationContract<IToolApprovalRuleStore>.CreateStoreAsync(), TenantIsolationContract<IToolApprovalRuleStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IToolApprovalRuleStore>.InitializeAsync(), TenantIsolationContract<IToolApprovalRuleStore>.DisposeAsync(), TenantIsolationContract<IToolApprovalRuleStore>.OnDisposeAsync(), TenantIsolationContract<IToolApprovalRuleStore>.SeedAsync(string, string), TenantIsolationContract<IToolApprovalRuleStore>.ExistsAsync(string, object), TenantIsolationContract<IToolApprovalRuleStore>.CountAsync(string), TenantIsolationContract<IToolApprovalRuleStore>.TryDeleteAsync(string, object), TenantIsolationContract<IToolApprovalRuleStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IToolApprovalRuleStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IToolApprovalRuleStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IToolApprovalRuleStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IToolApprovalRuleStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IToolApprovalRuleStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IToolApprovalRuleStore>.AmbientTenant, TenantIsolationContract<IToolApprovalRuleStore>.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 persisted approval rule is a security record: one tenant’s rule must never let another tenant’s tool call through without approval.
Constructors
Section titled “Constructors”ToolApprovalRuleStoreContract()
Section titled “ ToolApprovalRuleStoreContract()”protected ToolApprovalRuleStoreContract()Methods
Section titled “Methods”Added_rule_is_read_back()
Section titled “ Added_rule_is_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 29)]public Task Added_rule_is_read_back()Returns
Section titled “Returns”Argument_conditions_round_trip()
Section titled “ Argument_conditions_round_trip()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 67)]public Task Argument_conditions_round_trip()Returns
Section titled “Returns”Condition_scoped_rule_added_twice_leaves_a_single_record()
Section titled “ Condition_scoped_rule_added_twice_leaves_a_single_record()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 90)]public Task Condition_scoped_rule_added_twice_leaves_a_single_record()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.
Deleting_a_nonexistent_rule_returns_false()
Section titled “ Deleting_a_nonexistent_rule_returns_false()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 63)]public Task Deleting_a_nonexistent_rule_returns_false()Returns
Section titled “Returns”Different_agent_becomes_a_separate_rule()
Section titled “ Different_agent_becomes_a_separate_rule()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 54)]public Task Different_agent_becomes_a_separate_rule()Returns
Section titled “Returns”Different_conditions_become_a_separate_rule()
Section titled “ Different_conditions_become_a_separate_rule()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 112)]public Task Different_conditions_become_a_separate_rule()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.
Same_scope_added_twice_leaves_a_single_record()
Section titled “ Same_scope_added_twice_leaves_a_single_record()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 43)]public Task Same_scope_added_twice_leaves_a_single_record()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.