Shouldly
Search…
ContainKey

ShouldContainKey

1
var websters = new Dictionary<string, string> { { "Embiggen", "To empower or embolden." } };
2
websters.ShouldContainKey("Cromulent");
Copied!
Exception
1
websters
2
should contain key
3
"Cromulent"
4
but does not
Copied!

ShouldNotContainKey

1
var websters = new Dictionary<string, string> { { "Chazzwazzers", "What Australians would have called a bull frog." } };
2
websters.ShouldNotContainKey("Chazzwazzers");
Copied!
Exception
1
websters
2
should not contain key
3
"Chazzwazzers"
4
but does
Copied!