Skip to content

SubstringConstraint

Chris Maddock edited this page May 27, 2017 · 5 revisions

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 );
Clone this wiki locally