Search Results for

    Show / Hide Table of Contents

    Class CollectionSubsetConstraint

    CollectionSubsetConstraint is used to determine whether one collection is a subset of another

    Inheritance
    object
    Constraint
    CollectionConstraint
    CollectionItemsEqualConstraint
    CollectionSubsetConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    CollectionItemsEqualConstraint.Using(IComparer)
    CollectionItemsEqualConstraint.Using<T>(IComparer<T>)
    CollectionItemsEqualConstraint.Using<T>(Comparison<T>)
    CollectionItemsEqualConstraint.Using(IEqualityComparer)
    CollectionItemsEqualConstraint.Using<T>(IEqualityComparer<T>)
    CollectionItemsEqualConstraint.Using<T>(Func<T, T, bool>)
    CollectionItemsEqualConstraint.UsingPropertiesComparer()
    CollectionItemsEqualConstraint.ItemsEqual(object, object)
    CollectionItemsEqualConstraint.Tally(IEnumerable)
    CollectionItemsEqualConstraint.IgnoringCase
    CollectionItemsEqualConstraint.IgnoringWhiteSpace
    CollectionItemsEqualConstraint.UsingExternalComparer
    CollectionItemsEqualConstraint.IgnoreCase
    CollectionItemsEqualConstraint.IgnoreWhiteSpace
    CollectionConstraint.IsEmpty(IEnumerable)
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    Constraint.ApplyTo<TActual>(ref TActual)
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    Constraint.GetTestObject<TActual>(ActualValueDelegate<TActual>)
    Constraint.ToString()
    Constraint.GetStringRepresentation(IEnumerable)
    Constraint.GetStringRepresentation()
    Constraint.After(int)
    Constraint.After(int, int)
    Constraint.Arguments
    Constraint.Builder
    Constraint.And
    Constraint.With
    Constraint.Or
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class CollectionSubsetConstraint : CollectionItemsEqualConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    CollectionSubsetConstraint(IEnumerable)

    Construct a CollectionSubsetConstraint

    Declaration
    public CollectionSubsetConstraint(IEnumerable expected)
    Parameters
    Type Name Description
    IEnumerable expected

    The collection that the actual value is expected to be a subset of

    Properties

    View Source

    Description

    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
    Constraint.Description
    View Source

    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.

    Declaration
    public override string DisplayName { get; }
    Property Value
    Type Description
    string
    Overrides
    Constraint.DisplayName

    Methods

    View Source

    ApplyTo<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
    CollectionConstraint.ApplyTo<TActual>(TActual)
    View Source

    Matches(IEnumerable)

    Test whether the actual collection is a subset of the expected collection provided.

    Declaration
    protected override bool Matches(IEnumerable actual)
    Parameters
    Type Name Description
    IEnumerable actual
    Returns
    Type Description
    bool
    Overrides
    CollectionConstraint.Matches(IEnumerable)
    View Source

    Using<TSubsetElement, TSupersetElement>(Func<TSubsetElement, TSupersetElement, bool>)

    Flag the constraint to use the supplied predicate function

    Declaration
    public CollectionSubsetConstraint Using<TSubsetElement, TSupersetElement>(Func<TSubsetElement, TSupersetElement, bool> comparison)
    Parameters
    Type Name Description
    Func<TSubsetElement, TSupersetElement, bool> comparison

    The comparison function to use.

    Returns
    Type Description
    CollectionSubsetConstraint

    Self.

    Type Parameters
    Name Description
    TSubsetElement

    The type of the elements in the actual subset.

    TSupersetElement

    The type of the elements in the expected superset.

    Implements

    IConstraint
    IResolveConstraint
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0