Shouldly
Search…
Shouldly
Overview
Contributing
Documentation
Getting Started
Configuration
Equality
String
Enumerable
Dictionary
ContainKey
ContainKeyAndValue
Exceptions
SatisfyAllConditions
CompleteIn
DynamicShould
Upgrade 3 to 4
Powered By
GitBook
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!
snippet source
|
anchor
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!
snippet source
|
anchor
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!
Previous
ContainKey
Next - Documentation
Exceptions
Last modified
1yr ago
Copy link
Contents
ShouldContainKeyAndValue
ShouldNotContainKeyAndValue