Skip to content

LessThanConstraint

Charlie Poole edited this page Jan 31, 2016 · 5 revisions

LessThanConstraint tests that one value is less than another.

Constructor

```C# LessThanConstraint(object expected) ```

Syntax

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

Modifiers

```C# ...Using(IComparer comparer) ...Using(IComparer<T> comparer) ...Using(Comparison<T> comparer) ```

Examples of Use

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