.NET API
ToolArgumentValidationContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the consumer’s own IToolArgumentsValidator, fuzzed against one of the consumer’s own tools.
public abstract class ToolArgumentValidationContract : IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← ToolArgumentValidationContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
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”IToolArgumentsValidator promises fail-closed behavior: a
missing required field, a type mismatch, an out-of-range number, or a
pattern violation must be rejected, and a validator that throws must still
end up rejecting the call. Tracon tests that promise’s own wrapper
(ValidatingAIFunction) against synthetic validators; this contract
tests whether the consumer’s validator actually implements
the rule, using arguments generated from ToolArgumentValidationContract.Tool’s own
AIFunctionDeclaration.JsonSchema.
This contract does not ship a validator and does not require one to
reject or accept an unrecognized extra property either way — Tracon’s
stance is that JSON Schema validation, including additionalProperties,
stays inside the consumer’s own trust boundary. Override
ToolArgumentValidationContract.ExtraPropertyIsRejected to state which way ToolArgumentValidationContract.Validator
goes; the one thing this contract will not accept is silence.
A scenario this generator cannot build for ToolArgumentValidationContract.Tool’s schema (no required property, no numeric bound, no pattern, or a required property shaped like a nested object) is skipped with an explicit reason rather than passing silently.
Constructors
Section titled “Constructors”ToolArgumentValidationContract()
Section titled “ ToolArgumentValidationContract()”protected ToolArgumentValidationContract()Properties
Section titled “Properties”ExtraPropertyIsRejected
Section titled “ ExtraPropertyIsRejected”Whether ToolArgumentValidationContract.Validator is expected to reject an argument set that carries a property ToolArgumentValidationContract.Tool’s schema never declared.
protected virtual bool ExtraPropertyIsRejected { get; }Property Value
Section titled “Property Value”The seed the argument generator uses. Fixed by default for reproducibility (143.2).
protected virtual int Seed { get; }Property Value
Section titled “Property Value”The tool whose schema drives the generated arguments.
protected AIFunction Tool { get; }Property Value
Section titled “Property Value”AIFunction
Validator
Section titled “ Validator”The consumer’s own validator under test.
protected IToolArgumentsValidator Validator { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”A_pre_cancelled_token_is_honored()
Section titled “ A_pre_cancelled_token_is_honored()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 130)]public Task A_pre_cancelled_token_is_honored()Returns
Section titled “Returns”CreateToolAsync()
Section titled “ CreateToolAsync()”Creates the tool under test.
protected abstract ValueTask<AIFunction> CreateToolAsync()Returns
Section titled “Returns”ValueTask<AIFunction>
CreateValidatorAsync()
Section titled “ CreateValidatorAsync()”Creates the validator under test.
protected abstract ValueTask<IToolArgumentsValidator> CreateValidatorAsync()Returns
Section titled “Returns”ValueTask<IToolArgumentsValidator>
DisposeAsync()
Section titled “ DisposeAsync()”public ValueTask DisposeAsync()Returns
Section titled “Returns”InitializeAsync()
Section titled “ InitializeAsync()”Called immediately after the class has been created, before it is used.
public ValueTask InitializeAsync()Returns
Section titled “Returns”Missing_required_argument_is_rejected()
Section titled “ Missing_required_argument_is_rejected()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 74)]public Task Missing_required_argument_is_rejected()Returns
Section titled “Returns”Out_of_range_number_is_rejected()
Section titled “ Out_of_range_number_is_rejected()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 92)]public Task Out_of_range_number_is_rejected()Returns
Section titled “Returns”Pattern_violation_is_rejected()
Section titled “ Pattern_violation_is_rejected()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 101)]public Task Pattern_violation_is_rejected()Returns
Section titled “Returns”Throwing_validator_rejects_the_call()
Section titled “ Throwing_validator_rejects_the_call()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 123)]public Task Throwing_validator_rejects_the_call()Returns
Section titled “Returns”Type_mismatch_is_rejected()
Section titled “ Type_mismatch_is_rejected()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 83)]public Task Type_mismatch_is_rejected()Returns
Section titled “Returns”Unknown_extra_property_is_handled_deliberately()
Section titled “ Unknown_extra_property_is_handled_deliberately()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/Tools/ToolArgumentValidationContract.cs", 110)]public Task Unknown_extra_property_is_handled_deliberately()