# ContainKey

## ShouldContainKey

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

[snippet source](https://github.com/shouldly/shouldly/blob/master/src/DocumentationExamples/CodeExamples/DictionaryShouldContainKeyExamples.ShouldContainKey.codeSample.approved.cs#L1-L2) | [anchor](#snippet-DictionaryShouldContainKeyExamples.ShouldContainKey.codeSample.approved.cs)

**Exception**

```
websters
    should contain key
"Cromulent"
    but does not
```

## ShouldNotContainKey

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

[snippet source](https://github.com/shouldly/shouldly/blob/master/src/DocumentationExamples/CodeExamples/DictionaryShouldContainKeyExamples.ShouldNotContainKey.codeSample.approved.cs#L1-L2) | [anchor](#snippet-DictionaryShouldContainKeyExamples.ShouldNotContainKey.codeSample.approved.cs)

**Exception**

```
websters
    should not contain key
"Chazzwazzers"
    but does
```
