ContainKey

ShouldContainKey

var websters = new Dictionary<string, string> { { "Embiggen", "To empower or embolden." } };
websters.ShouldContainKey("Cromulent");

snippet source | anchor

Exception

websters
    should contain key
"Cromulent"
    but does not

ShouldNotContainKey

var websters = new Dictionary<string, string> { { "Chazzwazzers", "What Australians would have called a bull frog." } };
websters.ShouldNotContainKey("Chazzwazzers");

snippet source | anchor

Exception

websters
    should not contain key
"Chazzwazzers"
    but does

Last updated