.NET API
ContractCoverage
Tracon.Testing.Contracts.Xunit.dllVerifies that a test assembly derives every contract class this package ships for one contract family, so a class dropped during a refactor or never picked up for a new implementation is caught at build time instead of silently reducing coverage.
public static class ContractCoverageInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Tracon’s own four store implementations (in-memory, PostgreSQL, SQL Server, SQLite) each call ContractCoverage.MissingDerivedTypes from their own test assembly; a third-party implementation can do the same.
Every call names a family — the namespace the contracts live in, such as ContractCoverage.StorageContracts or ContractCoverage.ProviderContracts. There is deliberately no family-less overload: one used to exist, and adding a second family to this package would have made every existing caller fail with contracts that were never theirs to implement. A store implementer’s coverage check must not start failing because Tracon published a model-provider contract.
Fields
Section titled “Fields”AgentSourceContracts
Section titled “ AgentSourceContracts”The namespace holding agent-source contracts.
public const string AgentSourceContracts = "Tracon.Testing.Contracts.AgentSources"Field Value
Section titled “Field Value”JudgeContracts
Section titled “ JudgeContracts”The namespace holding run judge contracts.
public const string JudgeContracts = "Tracon.Testing.Contracts.Judges"Field Value
Section titled “Field Value”ProviderContracts
Section titled “ ProviderContracts”The namespace holding the model-provider contracts.
public const string ProviderContracts = "Tracon.Testing.Contracts.Providers"Field Value
Section titled “Field Value”SchedulingContracts
Section titled “ SchedulingContracts”The namespace holding job handler contracts.
public const string SchedulingContracts = "Tracon.Testing.Contracts.Scheduling"Field Value
Section titled “Field Value”StorageContracts
Section titled “ StorageContracts”The namespace holding the store contracts (IRunStore and the rest).
public const string StorageContracts = "Tracon.Testing.Contracts.Storage"Field Value
Section titled “Field Value”ToolContracts
Section titled “ ToolContracts”The namespace holding custom tool contracts.
public const string ToolContracts = "Tracon.Testing.Contracts.Tools"Field Value
Section titled “Field Value”Methods
Section titled “Methods”ContractTypes(string)
Section titled “ ContractTypes(string)”The contract classes this package ships for one family: every
non-generic public abstract type in
namespaceScope whose name ends in Contract.
[RequiresUnreferencedCode("Reflects over every type in this assembly. Build-time test infrastructure only; never called from application code.")]public static IReadOnlyList<Type> ContractTypes(string namespaceScope)Parameters
Section titled “Parameters”namespaceScope string
The contract family, normally ContractCoverage.StorageContracts or ContractCoverage.ProviderContracts.
Returns
Section titled “Returns”The contract types, ordered by name.
Exceptions
Section titled “Exceptions”namespaceScope is empty, or names no contract type
at all. A namespace that matches nothing is a typo, not an empty
family: reporting zero contracts would make a coverage check pass
while checking nothing.
MissingDerivedTypes(Assembly, string, IReadOnlyCollection<string>?)
Section titled “ MissingDerivedTypes(Assembly, string, IReadOnlyCollection<string>?)”The contract classes in one family that consumerAssembly
declares no concrete derived type for.
[RequiresUnreferencedCode("Reflects over every type in the consumer assembly. Build-time test infrastructure only; never called from application code.")]public static IReadOnlyList<string> MissingDerivedTypes(Assembly consumerAssembly, string namespaceScope, IReadOnlyCollection<string>? except = null)Parameters
Section titled “Parameters”consumerAssembly Assembly
The test assembly to check, typically Assembly.GetExecutingAssembly
from the caller.
namespaceScope string
The contract family to check, normally ContractCoverage.StorageContracts or ContractCoverage.ProviderContracts. Contracts outside it are ignored, so a consumer that implements one family is unaffected by the others.
except IReadOnlyCollection<string>?
Contract type names this assembly intentionally does not cover (for
example, a contract for a store shape this deployment does not offer).
A name that does not match any contract type is itself reported back,
the same way TenantCoverageTests.Coverage_list_carries_no_stale_entries
catches a stale exemption: an exemption for a contract that no longer
exists, or was never spelled correctly, must not silently pass.
Returns
Section titled “Returns”The names of the uncovered, non-exempt contract types, ordered by
name, followed by any stale except entry (prefixed
"stale exemption: "); empty when every contract type is either
covered or validly exempted.
Exceptions
Section titled “Exceptions”consumerAssembly is null.
namespaceScope names no contract type.