.NET API
TenantProviderBindingStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the ITenantProviderBindingStore contract.
public abstract class TenantProviderBindingStoreContract : TenantIsolationContract<ITenantProviderBindingStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<ITenantProviderBindingStore> ← TenantProviderBindingStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<ITenantProviderBindingStore>.TenantA, TenantIsolationContract<ITenantProviderBindingStore>.TenantB, TenantIsolationContract<ITenantProviderBindingStore>.CreateStoreAsync(), TenantIsolationContract<ITenantProviderBindingStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<ITenantProviderBindingStore>.InitializeAsync(), TenantIsolationContract<ITenantProviderBindingStore>.DisposeAsync(), TenantIsolationContract<ITenantProviderBindingStore>.OnDisposeAsync(), TenantIsolationContract<ITenantProviderBindingStore>.SeedAsync(string, string), TenantIsolationContract<ITenantProviderBindingStore>.ExistsAsync(string, object), TenantIsolationContract<ITenantProviderBindingStore>.CountAsync(string), TenantIsolationContract<ITenantProviderBindingStore>.TryDeleteAsync(string, object), TenantIsolationContract<ITenantProviderBindingStore>.TryOverwriteAsync(string, string), TenantIsolationContract<ITenantProviderBindingStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<ITenantProviderBindingStore>.Tenant_reads_its_own_record(), TenantIsolationContract<ITenantProviderBindingStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<ITenantProviderBindingStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<ITenantProviderBindingStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<ITenantProviderBindingStore>.AmbientTenant, TenantIsolationContract<ITenantProviderBindingStore>.Store, 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 never asserts a secret value: the store carries only the configuration key’s NAME. It exists to prove tenant isolation and round-tripping of that name plus the optional endpoint.
Constructors
Section titled “Constructors”TenantProviderBindingStoreContract()
Section titled “ TenantProviderBindingStoreContract()”protected TenantProviderBindingStoreContract()Methods
Section titled “Methods”A_binding_is_deleted_whatever_case_the_caller_uses()
Section titled “ A_binding_is_deleted_whatever_case_the_caller_uses()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 93)]public Task A_binding_is_deleted_whatever_case_the_caller_uses()Returns
Section titled “Returns”A_binding_saved_under_a_different_case_replaces_the_existing_one()
Section titled “ A_binding_saved_under_a_different_case_replaces_the_existing_one()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 79)]public Task A_binding_saved_under_a_different_case_replaces_the_existing_one()Returns
Section titled “Returns”A_provider_name_is_matched_case_insensitively(string, string)
Section titled “ A_provider_name_is_matched_case_insensitively(string, string)”[Theory("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 62)][InlineData(new object?[] { "OpenAI", "openai" })][InlineData(new object?[] { "openai", "OpenAI" })][InlineData(new object?[] { "OPENAI", "openai" })]public Task A_provider_name_is_matched_case_insensitively(string savedAs, string requestedAs)Parameters
Section titled “Parameters”savedAs string
requestedAs string
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.
Endpoint_is_optional()
Section titled “ Endpoint_is_optional()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 47)]public Task Endpoint_is_optional()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.
Listing_returns_every_provider_binding_of_the_tenant()
Section titled “ Listing_returns_every_provider_binding_of_the_tenant()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 114)]public Task Listing_returns_every_provider_binding_of_the_tenant()Returns
Section titled “Returns”Missing_binding_returns_null()
Section titled “ Missing_binding_returns_null()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 58)]public Task Missing_binding_returns_null()Returns
Section titled “Returns”Saved_binding_is_read_back()
Section titled “ Saved_binding_is_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 33)]public Task Saved_binding_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.
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_binding_for_the_same_tenant_and_provider()
Section titled “ Upsert_replaces_the_existing_binding_for_the_same_tenant_and_provider()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TenantProviderBindingStoreContract.cs", 102)]public Task Upsert_replaces_the_existing_binding_for_the_same_tenant_and_provider()