Shouldly
Search…
ContainKeyAndValue

ShouldContainKeyAndValue

1
var websters = new Dictionary<string, string> { { "Cromulent", "I never heard the word before moving to Springfield." } };
2
websters.ShouldContainKeyAndValue("Cromulent", "Fine, acceptable.");
Copied!
Exception
1
websters
2
should contain key
3
"Cromulent"
4
with value
5
"Fine, acceptable."
6
but value was
7
"I never heard the word before moving to Springfield."
Copied!

ShouldNotContainKeyAndValue

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