Skip to content

LessThanConstraint

jnm2 edited this page Jun 14, 2017 · 5 revisions

LessThanConstraint tests that one value is less than another.

Constructor

LessThanConstraint(object expected)

Syntax

Is.LessThan(object expected)
Is.Negative // Equivalent to Is.LessThan(0)

Modifiers

...Using(IComparer comparer)
...Using<T>(IComparer<T> comparer)
...Using<T>(Comparison<T> comparer)

Examples of Use

Assert.That(3, Is.LessThan(7));
Assert.That(myOwnObject, 
    Is.LessThan(theExpected).Using(myComparer));
Assert.That(-5, Is.Negative);
Clone this wiki locally