Class CollectionSupersetConstraint
CollectionSupersetConstraint is used to determine whether one collection is a superset of another
Inheritance
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class CollectionSupersetConstraint : CollectionItemsEqualConstraint, IConstraint, IResolveConstraint
Constructors
View SourceCollectionSupersetConstraint(IEnumerable)
Construct a CollectionSupersetConstraint
Declaration
public CollectionSupersetConstraint(IEnumerable expected)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable | expected | The collection that the actual value is expected to be a superset of |
Properties
View SourceDescription
The Description of what this constraint tests, for use in messages and in the ConstraintResult.
Declaration
public override string Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
View SourceDisplayName
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.
Declaration
public override string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
View SourceApplyTo<TActual>(TActual)
Test whether the constraint is satisfied by a given value.
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
| Type | Name | Description |
|---|---|---|
| TActual | actual |
Returns
| Type | Description |
|---|---|
| ConstraintResult |
Type Parameters
| Name | Description |
|---|---|
| TActual |
Overrides
View SourceMatches(IEnumerable)
Test whether the actual collection is a superset of the expected collection provided.
Declaration
protected override bool Matches(IEnumerable actual)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable | actual |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
View SourceUsing<TSupersetElement, TSubsetElement>(Func<TSupersetElement, TSubsetElement, bool>)
Flag the constraint to use the supplied predicate function
Declaration
public CollectionSupersetConstraint Using<TSupersetElement, TSubsetElement>(Func<TSupersetElement, TSubsetElement, bool> comparison)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TSupersetElement, TSubsetElement, bool> | comparison | The comparison function to use. |
Returns
| Type | Description |
|---|---|
| CollectionSupersetConstraint | Self. |
Type Parameters
| Name | Description |
|---|---|
| TSupersetElement | The type of the elements in the actual superset. |
| TSubsetElement | The type of the elements in the expected subset. |