LessThanConstraint
Tests whether a value is less than the value supplied to its constructor
using System.Runtime.CompilerServices;
namespace NUnit.Framework.Constraints
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public class LessThanConstraint : ComparisonConstraint
{
public LessThanConstraint(object expected)
: base(expected, "less than ")
{
}
protected override bool PerformComparison(ComparisonAdapter comparer, object actual, object expected, Tolerance tolerance)
{
return comparer.Compare(actual, tolerance.ApplyToValue(expected).UpperBound) < 0;
}
}
}