.NET API
TenantEgressPolicyStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the ITenantEgressPolicyStore contract.
public abstract class TenantEgressPolicyStoreContract : TenantIsolationContract<ITenantEgressPolicyStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<ITenantEgressPolicyStore> ← TenantEgressPolicyStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<ITenantEgressPolicyStore>.TenantA, TenantIsolationContract<ITenantEgressPolicyStore>.TenantB, TenantIsolationContract<ITenantEgressPolicyStore>.CreateStoreAsync(), TenantIsolationContract<ITenantEgressPolicyStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<ITenantEgressPolicyStore>.InitializeAsync(), TenantIsolationContract<ITenantEgressPolicyStore>.DisposeAsync(), TenantIsolationContract<ITenantEgressPolicyStore>.OnDisposeAsync(), TenantIsolationContract<ITenantEgressPolicyStore>.SeedAsync(string, string), TenantIsolationContract<ITenantEgressPolicyStore>.ExistsAsync(string, object), TenantIsolationContract<ITenantEgressPolicyStore>.CountAsync(string), TenantIsolationContract<ITenantEgressPolicyStore>.TryDeleteAsync(string, object), TenantIsolationContract<ITenantEgressPolicyStore>.TryOverwriteAsync(string, string), TenantIsolationContract<ITenantEgressPolicyStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<ITenantEgressPolicyStore>.Tenant_reads_its_own_record(), TenantIsolationContract<ITenantEgressPolicyStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<ITenantEgressPolicyStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<ITenantEgressPolicyStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<ITenantEgressPolicyStore>.AmbientTenant, TenantIsolationContract<ITenantEgressPolicyStore>.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 tenant carries at most ONE policy (there is no “name” dimension), so the
isolation base’s generic name parameter is ignored here; every
scenario still proves the SAME thing the other store contracts do:
tenant A’s policy is invisible to and unwritable by tenant B.
Constructors
Section titled “Constructors”TenantEgressPolicyStoreContract()
Section titled “ TenantEgressPolicyStoreContract()”protected TenantEgressPolicyStoreContract()Methods
Section titled “Methods”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_the_policy_makes_the_tenant_unrestricted_again()
Section titled “ Deleting_the_policy_makes_the_tenant_unrestricted_again()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantEgressPolicyStoreContract.cs", 62)]public Task Deleting_the_policy_makes_the_tenant_unrestricted_again()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.
Saved_policy_is_read_back()
Section titled “ Saved_policy_is_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantEgressPolicyStoreContract.cs", 34)]public Task Saved_policy_is_read_back()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_with_no_saved_policy_is_unrestricted()
Section titled “ Tenant_with_no_saved_policy_is_unrestricted()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantEgressPolicyStoreContract.cs", 46)]public Task Tenant_with_no_saved_policy_is_unrestricted()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.
Upsert_replaces_the_existing_policy()
Section titled “ Upsert_replaces_the_existing_policy()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantEgressPolicyStoreContract.cs", 50)]public Task Upsert_replaces_the_existing_policy()