Class TargetToleranceValidator
- Namespace
- Acuit.Pinpoint.Workflows.Testing.Validation
- Assembly
- Acuit.Pinpoint.Workflows.Testing.dll
A data value validator that validates that the data value is within a specified tolerance of a specified target value.
public class TargetToleranceValidator : IDataValueValidator
- Inheritance
-
TargetToleranceValidator
- Implements
- Inherited Members
Examples
<TakeValue Name="Gas Flow" DataSource="{ReadingNow GasFlowRate}">
<TakeValue.Validator>
<TargetToleranceValidator Target="70" Tolerance="10" />
</TakeValue.Validator>
</TakeValue>
Properties
Target
Gets or sets the target value. This is required.
public ValueSource<double> Target { get; set; }
Property Value
Tolerance
Gets or sets the maximum allowed tolerance, as either an absolute value or as a percentage of the target value. This is required.
public ValueSource<DoubleTolerance> Tolerance { get; set; }
Property Value
Methods
InitializeAsync(ActivityContext, IDataValueDescriptor, CancellationToken)
Initializes the validator.
public Task<IInitializedDataValueValidator> InitializeAsync(ActivityContext context, IDataValueDescriptor dataValueDescriptor, CancellationToken cancellationToken)
Parameters
context
ActivityContextThe activity context.
dataValueDescriptor
IDataValueDescriptorThe data value descriptor.
cancellationToken
CancellationTokenA CancellationToken that can request cancellation.
Returns
- Task<IInitializedDataValueValidator>
A task that represents the asynchronous operation. The value of its Result property contains an IInitializedDataValueValidator representing the initialized validator.
Exceptions
- ArgumentNullException
context
is null.- ArgumentNullException
dataValueDescriptor
is null.- Exception
The validator could not be initialized. The exception type will depend on the implementation.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.