Class CollectionEquivalentConstraint
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
CollectionEquivalentConstraint is used to determine whether two collections are equivalent.
public class CollectionEquivalentConstraint : CollectionItemsEqualConstraint, IConstraint, IResolveConstraint
- Inheritance
-
CollectionEquivalentConstraint
- Implements
- Inherited Members
Constructors
CollectionEquivalentConstraint(IEnumerable)
Construct a CollectionEquivalentConstraint
public CollectionEquivalentConstraint(IEnumerable expected)
Parameters
expected
IEnumerableExpected collection.
Properties
Description
The Description of what this constraint tests, for use in messages and in the ConstraintResult.
public override string Description { get; }
Property Value
DisplayName
The display name of this Constraint for use by ToString(). The default value is the name of the constraint with trailing "Constraint" removed. Derived classes may set this to another name in their constructors.
public override string DisplayName { get; }
Property Value
Methods
ApplyTo<TActual>(TActual)
Test whether the collection is equivalent to the expected.
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
actual
TActualActual collection to compare.
Returns
- ConstraintResult
A CollectionEquivalentConstraintResult indicating whether or not the two collections are equivalent.
Type Parameters
TActual
Actual collection type.
Matches(IEnumerable)
protected override bool Matches(IEnumerable actual)
Parameters
actual
IEnumerable
Returns
Using<TActual, TExpected>(Func<TActual, TExpected, bool>)
Flag the constraint to use the supplied predicate function
public CollectionEquivalentConstraint Using<TActual, TExpected>(Func<TActual, TExpected, bool> comparison)
Parameters
Returns
Type Parameters
TActual
TExpected