Class CollectionSupersetConstraint
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
CollectionSupersetConstraint is used to determine whether one collection is a superset of another
public class CollectionSupersetConstraint : CollectionItemsEqualConstraint, IConstraint, IResolveConstraint
- Inheritance
-
CollectionSupersetConstraint
- Implements
- Inherited Members
Constructors
CollectionSupersetConstraint(IEnumerable)
Construct a CollectionSupersetConstraint
public CollectionSupersetConstraint(IEnumerable expected)
Parameters
expected
IEnumerableThe collection that the actual value is expected to be a superset of
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 constraint is satisfied by a given value.
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
actual
TActual
Returns
Type Parameters
TActual
Matches(IEnumerable)
Test whether the actual collection is a superset of the expected collection provided.
protected override bool Matches(IEnumerable actual)
Parameters
actual
IEnumerable
Returns
Using<TSupersetType, TSubsetType>(Func<TSupersetType, TSubsetType, bool>)
Flag the constraint to use the supplied predicate function
public CollectionSupersetConstraint Using<TSupersetType, TSubsetType>(Func<TSupersetType, TSubsetType, bool> comparison)
Parameters
Returns
Type Parameters
TSupersetType
TSubsetType