Shouldly
Search…
Contain

ShouldContain

1
var target = "Homer";
2
target.ShouldContain("Bart");
Copied!
Exception
1
target
2
should contain (case insensitive comparison)
3
"Bart"
4
but was actually
5
"Homer"
Copied!

ShouldContainWithoutWhitespace

1
var target = "Homer Simpson";
2
target.ShouldContainWithoutWhitespace(" Bart Simpson ");
Copied!
Exception
1
target
2
should contain without whitespace
3
" Bart Simpson "
4
but was actually
5
"Homer Simpson"
Copied!

ShouldNotContain

1
var target = "Homer";
2
target.ShouldNotContain("Home");
Copied!
Exception
1
target
2
should not contain (case insensitive comparison)
3
"Home"
4
but was actually
5
"Homer"
Copied!
Last modified 1yr ago