Contain

ShouldContain

var target = "Homer";
target.ShouldContain("Bart");

snippet source | anchor

Exception

target
    should contain (case insensitive comparison)
"Bart"
    but was actually
"Homer"

ShouldContainWithoutWhitespace

var target = "Homer Simpson";
target.ShouldContainWithoutWhitespace(" Bart Simpson ");

snippet source | anchor

Exception

target
    should contain without whitespace
" Bart Simpson "
    but was actually
"Homer Simpson"

ShouldNotContain

var target = "Homer";
target.ShouldNotContain("Home");

snippet source | anchor

Exception

target
    should not contain (case insensitive comparison)
"Home"
    but was actually
"Homer"

Last updated