.NET API
AttachmentStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IAttachmentStore contract.
public abstract class AttachmentStoreContract : TenantIsolationContract<IAttachmentStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IAttachmentStore> ← AttachmentStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IAttachmentStore>.TenantA, TenantIsolationContract<IAttachmentStore>.TenantB, TenantIsolationContract<IAttachmentStore>.CreateStoreAsync(), TenantIsolationContract<IAttachmentStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IAttachmentStore>.InitializeAsync(), TenantIsolationContract<IAttachmentStore>.DisposeAsync(), TenantIsolationContract<IAttachmentStore>.OnDisposeAsync(), TenantIsolationContract<IAttachmentStore>.SeedAsync(string, string), TenantIsolationContract<IAttachmentStore>.ExistsAsync(string, object), TenantIsolationContract<IAttachmentStore>.CountAsync(string), TenantIsolationContract<IAttachmentStore>.TryDeleteAsync(string, object), TenantIsolationContract<IAttachmentStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IAttachmentStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IAttachmentStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IAttachmentStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IAttachmentStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IAttachmentStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IAttachmentStore>.AmbientTenant, TenantIsolationContract<IAttachmentStore>.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, tenant isolation and attachments being removed when a session is deleted must behave identically.
Constructors
Section titled “Constructors”AttachmentStoreContract()
Section titled “ AttachmentStoreContract()”protected AttachmentStoreContract()Methods
Section titled “Methods”Another_tenants_attachment_is_not_visible()
Section titled “ Another_tenants_attachment_is_not_visible()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 72)]public Task Another_tenants_attachment_is_not_visible()Returns
Section titled “Returns”Bulk_delete_by_session_removes_only_matches()
Section titled “ Bulk_delete_by_session_removes_only_matches()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 107)]public Task Bulk_delete_by_session_removes_only_matches()Returns
Section titled “Returns”Content_is_read_back_as_is()
Section titled “ Content_is_read_back_as_is()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 57)]public Task Content_is_read_back_as_is()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.
Delete_succeeds_once_and_returns_false_the_second_time()
Section titled “ Delete_succeeds_once_and_returns_false_the_second_time()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 97)]public Task Delete_succeeds_once_and_returns_false_the_second_time()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_filters_by_session()
Section titled “ Listing_filters_by_session()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 84)]public Task Listing_filters_by_session()Returns
Section titled “Returns”Record_metadata_is_stored_correctly()
Section titled “ Record_metadata_is_stored_correctly()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 43)]public Task Record_metadata_is_stored_correctly()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.
Session_based_delete_does_not_delete_the_others_attachments()
Section titled “ Session_based_delete_does_not_delete_the_others_attachments()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/AttachmentStoreContract.cs", 137)]public Task Session_based_delete_does_not_delete_the_others_attachments()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.