Table of Contents

Class DictionaryContainsKeyConstraint

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

DictionaryContainsKeyConstraint is used to test whether a dictionary contains an expected object as a key.

public class DictionaryContainsKeyConstraint : CollectionContainsConstraint, IConstraint, IResolveConstraint
Inheritance
DictionaryContainsKeyConstraint
Implements
Inherited Members

Constructors

DictionaryContainsKeyConstraint(object)

Construct a DictionaryContainsKeyConstraint

public DictionaryContainsKeyConstraint(object expected)

Parameters

expected object

Properties

Description

The Description of what this constraint tests, for use in messages and in the ConstraintResult.

public override string Description { get; }

Property Value

string

Methods

Matches(IEnumerable)

Test whether the expected key is contained in the dictionary

protected override bool Matches(IEnumerable actual)

Parameters

actual IEnumerable

Returns

bool