Documentation
Table of Contents

Class TargetContractScript

Namespace
IntentSharp.Testing
Assembly
IntentSharp.dll

What RunAsync(ITarget, TargetContractScript, CancellationToken) runs against a target: the request, the command the scripted model plans for it, the entities the target's inspection must name and the records the execution must return. The command must be one the target runs as a read of data the target already holds.

public sealed class TargetContractScript
Inheritance
object
TargetContractScript
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Extension Methods

Constructors

TargetContractScript()

Creates a script; set at least Request, Command and ExpectedEntities.

Properties

Command

The command the scripted model plans, in the shape the target's CommandSchema declares: a JSON string for a command written as text, or the JSON value the schema describes.

ExpectedEntities

The entities the target's inspection of Command must name, by entity name (the path joined with dots), compared exactly, in any order and with repeats ignored. Each must be one the target's description names. The list must name at least one entity and hold no empty or blank name; the kit fails any other list at the script step, before it describes the target. A command that touches no entity, one whose inspection sets TouchesNoEntity, is therefore not one the kit can run.

ExpectedMinRecords

The fewest records the execution must return; 1 by default, 0 to accept an empty result.

ExtraSubjectValues

Rules for the subjects the target declares beyond the core's, as subject=value entries, such as "sql.inlineValues=0". An entry whose value is a whole number becomes a count rule with that maximum; any other value is allowed by an allow rule that lists every value given for the subject. A subject the target declares as required must have an entry, or every check is refused. Empty by default.

Parameters

The parameter values the scripted model supplies with Command, by name; empty by default.

Request

The request the operation runs for, in plain language, such as "List the open orders.".