Search Results for

    Show / Hide Table of Contents

    LessThan Constraint

    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)
    ...Within(object tolerance)
    

    Examples of Use

    [Test]
    public void LessThan_Examples()
    {
        Assert.That(3, Is.LessThan(7));
        Assert.That(-5, Is.Negative);
    }
    
    • Edit this page
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0