.NET API
SkillScriptGrantContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the ISkillScriptGrantStore contract.
public abstract class SkillScriptGrantContract : TenantIsolationContract<ISkillScriptGrantStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<ISkillScriptGrantStore> ← SkillScriptGrantContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<ISkillScriptGrantStore>.TenantA, TenantIsolationContract<ISkillScriptGrantStore>.TenantB, TenantIsolationContract<ISkillScriptGrantStore>.CreateStoreAsync(), TenantIsolationContract<ISkillScriptGrantStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<ISkillScriptGrantStore>.InitializeAsync(), TenantIsolationContract<ISkillScriptGrantStore>.DisposeAsync(), TenantIsolationContract<ISkillScriptGrantStore>.OnDisposeAsync(), TenantIsolationContract<ISkillScriptGrantStore>.SeedAsync(string, string), TenantIsolationContract<ISkillScriptGrantStore>.ExistsAsync(string, object), TenantIsolationContract<ISkillScriptGrantStore>.CountAsync(string), TenantIsolationContract<ISkillScriptGrantStore>.TryDeleteAsync(string, object), TenantIsolationContract<ISkillScriptGrantStore>.TryOverwriteAsync(string, string), TenantIsolationContract<ISkillScriptGrantStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<ISkillScriptGrantStore>.Tenant_reads_its_own_record(), TenantIsolationContract<ISkillScriptGrantStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<ISkillScriptGrantStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<ISkillScriptGrantStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<ISkillScriptGrantStore>.AmbientTenant, TenantIsolationContract<ISkillScriptGrantStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Every implementation must pass the same scenarios; in particular, the “the narrower grant wins over the broader one” rule and the fact that a revoked grant never comes back must behave identically.
Constructors
Section titled “Constructors”SkillScriptGrantContract()
Section titled “ SkillScriptGrantContract()”protected SkillScriptGrantContract()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.
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_grant_is_not_returned()
Section titled “ Expired_grant_is_not_returned()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 66)]public Task Expired_grant_is_not_returned()Returns
Section titled “Returns”Grant_does_not_leak_across_tenants()
Section titled “ Grant_does_not_leak_across_tenants()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 56)]public Task Grant_does_not_leak_across_tenants()Returns
Section titled “Returns”Granting_the_same_grant_twice_leaves_a_single_record()
Section titled “ Granting_the_same_grant_twice_leaves_a_single_record()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 87)]public Task Granting_the_same_grant_twice_leaves_a_single_record()Returns
Section titled “Returns”Revoked_grant_can_be_granted_again()
Section titled “ Revoked_grant_can_be_granted_again()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 101)]public Task Revoked_grant_can_be_granted_again()Returns
Section titled “Returns”Revoked_grant_is_invalid()
Section titled “ Revoked_grant_is_invalid()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 76)]public Task Revoked_grant_is_invalid()Returns
Section titled “Returns”Script_specific_grant_wins_over_the_skill_wide_grant()
Section titled “ Script_specific_grant_wins_over_the_skill_wide_grant()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 44)]public Task Script_specific_grant_wins_over_the_skill_wide_grant()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.
Skill_wide_grant_covers_every_script()
Section titled “ Skill_wide_grant_covers_every_script()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/SkillScriptGrantContract.cs", 33)]public Task Skill_wide_grant_covers_every_script()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.
Remarks
Section titled “Remarks”A grant is not deleted, it is revoked.