Table of Contents

Class CollectionContainsConstraint

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

CollectionContainsConstraint is used to test whether a collection contains an expected object as a member.

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

Constructors

CollectionContainsConstraint(object)

Construct a CollectionContainsConstraint

public CollectionContainsConstraint(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 item is contained in the collection

protected override bool Matches(IEnumerable actual)

Parameters

actual IEnumerable

Returns

bool