Skip to content

ReadOnlyDictionaryAssertions<TDictionary, TKey, TValue>.ContainKey Method ​

Definition ​

Asserts that the dictionary contains the specified key.

c#
public AssertionsChain<ReadOnlyDictionaryAssertions<TDictionary, TKey, TValue>, TDictionary> ContainKey(TKey? key);

View source

Parameters ​

NameTypeDescription
keyTKeyThe key that should be present.

Returns ​

AssertionsChain<ReadOnlyDictionaryAssertions<TDictionary, TKey, TValue>, TDictionary>

An AssertionsChain<TAssertions, T> for chaining further assertions.