.NET API
ToolInvocationContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IRunStore tool-invocation contract.
public abstract class ToolInvocationContract : TenantIsolationContract<IRunStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IRunStore> ← ToolInvocationContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IRunStore>.TenantA, TenantIsolationContract<IRunStore>.TenantB, TenantIsolationContract<IRunStore>.CreateStoreAsync(), TenantIsolationContract<IRunStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IRunStore>.InitializeAsync(), TenantIsolationContract<IRunStore>.DisposeAsync(), TenantIsolationContract<IRunStore>.OnDisposeAsync(), TenantIsolationContract<IRunStore>.SeedAsync(string, string), TenantIsolationContract<IRunStore>.ExistsAsync(string, object), TenantIsolationContract<IRunStore>.CountAsync(string), TenantIsolationContract<IRunStore>.TryDeleteAsync(string, object), TenantIsolationContract<IRunStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IRunStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IRunStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IRunStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IRunStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IRunStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IRunStore>.AmbientTenant, TenantIsolationContract<IRunStore>.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; the summary is computed in the store itself, not by fetching rows and aggregating them in memory.
Constructors
Section titled “Constructors”ToolInvocationContract()
Section titled “ ToolInvocationContract()”protected ToolInvocationContract()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.
Failed_invocation_is_counted_as_unsuccessful()
Section titled “ Failed_invocation_is_counted_as_unsuccessful()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 148)]public Task Failed_invocation_is_counted_as_unsuccessful()Returns
Section titled “Returns”Invocation_fields_round_trip()
Section titled “ Invocation_fields_round_trip()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 44)]public Task Invocation_fields_round_trip()Returns
Section titled “Returns”Invocation_with_no_reported_usage_comes_back_with_EMPTY_usage()
Section titled “ Invocation_with_no_reported_usage_comes_back_with_EMPTY_usage()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 117)]public Task Invocation_with_no_reported_usage_comes_back_with_EMPTY_usage()Returns
Section titled “Returns”Invocations_come_back_in_time_order()
Section titled “ Invocations_come_back_in_time_order()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 166)]public Task Invocations_come_back_in_time_order()Returns
Section titled “Returns”Non_token_measurement_round_trips()
Section titled “ Non_token_measurement_round_trips()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 76)]public Task Non_token_measurement_round_trips()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.
Remarks
Section titled “Remarks”A tool invocation is attached to a run; isolation is established through the run’s tenant.
Summary_does_not_count_another_tenants_invocations()
Section titled “ Summary_does_not_count_another_tenants_invocations()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 236)]public Task Summary_does_not_count_another_tenants_invocations()Returns
Section titled “Returns”Summary_is_aggregated_per_tool()
Section titled “ Summary_is_aggregated_per_tool()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 188)]public Task Summary_is_aggregated_per_tool()Returns
Section titled “Returns”Summary_is_ordered_by_call_count_and_limited()
Section titled “ Summary_is_ordered_by_call_count_and_limited()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 217)]public Task Summary_is_ordered_by_call_count_and_limited()Returns
Section titled “Returns”Unknown_duration_stays_empty()
Section titled “ Unknown_duration_stays_empty()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolInvocationContract.cs", 132)]public Task Unknown_duration_stays_empty()