Search Results for

    Show / Hide Table of Contents

    Substring Constraint

    SubstringConstraint tests for a substring.

    Constructor

    SubstringConstraint(string expected)
    

    Syntax

    Does.Contain(string expected)
    

    Modifiers

    ...IgnoreCase
    

    Examples of Use

    string phrase = "Make your tests fail before passing!";
    
    Assert.That(phrase, Does.Contain("tests fail"));
    Assert.That(phrase, Does.Not.Contain("tests pass"));
    Assert.That(phrase, Does.Contain("make").IgnoreCase);
    
    • 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