Class MinMaxValidator
- 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 range (i.e., greater than or equal to a specified minimum value and less than or equal to a specified maximum value).
public class MinMaxValidator : IDataValueValidator
- Inheritance
-
MinMaxValidator
- Implements
- Inherited Members
Examples
<TakeValue Name="Gas Flow" DataSource="{ReadingNow GasFlowRate}">
<TakeValue.Validator>
<MinMaxValidator Minimum="60" Maximum="80" />
</TakeValue.Validator>
</TakeValue>
Remarks
See ValidationComparer for details about how values are compared.
Properties
Maximum
Gets or sets the maximum value. This is required.
public ValueSource Maximum { get; set; }
Property Value
Minimum
Gets or sets the minimum value. This is required.
public ValueSource Minimum { 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.