Class RangeConstraint
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
RangeConstraint tests whethe two _values are within a specified range.
public class RangeConstraint : Constraint, IConstraint, IResolveConstraint
- Inheritance
-
RangeConstraint
- Implements
- Inherited Members
Constructors
RangeConstraint(IComparable, IComparable)
Initializes a new instance of the RangeConstraint class.
public RangeConstraint(IComparable from, IComparable to)
Parameters
from
IComparableInclusive beginning of the range. Must be less than or equal to to.
to
IComparableInclusive end of the range. Must be greater than or equal to from.
Remarks
from must be less than or equal to true
Properties
Description
Gets text describing a constraint
public override string Description { get; }
Property Value
Methods
ApplyTo<TActual>(TActual)
Test whether the constraint is satisfied by a given value
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
actual
TActualThe value to be tested
Returns
- ConstraintResult
True for success, false for failure
Type Parameters
TActual
Using(IComparer)
Modifies the constraint to use an IComparer and returns self.
public RangeConstraint Using(IComparer comparer)
Parameters
comparer
IComparer
Returns
Using<T>(IComparer<T>)
Modifies the constraint to use an IComparer<T> and returns self.
public RangeConstraint Using<T>(IComparer<T> comparer)
Parameters
comparer
IComparer<T>
Returns
Type Parameters
T
Using<T>(Comparison<T>)
Modifies the constraint to use a Comparison<T> and returns self.
public RangeConstraint Using<T>(Comparison<T> comparer)
Parameters
comparer
Comparison<T>
Returns
Type Parameters
T