Search Results for

    Show / Hide Table of Contents

    EndsWith Constraint

    EndsWithConstraint tests for an ending string.

    Constructor

    EndsWithConstraint(string expected)
    

    Syntax

    Does.EndWith(string expected)
    EndsWith(string expected)
    

    Modifiers

    ...IgnoreCase
    

    Examples of Use

    string phrase = "Make your tests fail before passing!";
    
    Assert.That(phrase, Does.EndWith("!"));
    Assert.That(phrase, Does.EndWith("PASSING!").IgnoreCase);
    

    Notes

    1. EndsWith may appear only in the body of a constraint expression or when the inherited syntax is used.
    • 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