<PackageReference Include="NUnit" Version="4.3.2" />

ComparisonConstraint

public abstract class ComparisonConstraint : Constraint
Abstract base class for constraints that compare values to determine if one is greater than, equal to or less than the other.
public ComparisonConstraint Percent { get; }

Switches the .Within() modifier to interpret its tolerance as a percentage that the actual values is allowed to deviate from the expected value.

protected ComparisonConstraint(object expected, string comparisonText)

Initializes a new instance of the ComparisonConstraint class.

protected abstract bool PerformComparison(ComparisonAdapter comparer, object actual, object expected, Tolerance tolerance)

Protected function overridden by derived class to actually perform the comparison

Modifies the constraint to use an IComparer and returns self

public ComparisonConstraint Using<T>(IComparer<T> comparer)

Modifies the constraint to use an IComparer<T> and returns self

public ComparisonConstraint Using<T>(Comparison<T> comparer)

Modifies the constraint to use a Comparison<T> and returns self

public ComparisonConstraint Within(object amount)

Set the tolerance for use in this comparison