Search Results for

    Show / Hide Table of Contents

    Class CollectionConstraint

    CollectionConstraint is the abstract base class for constraints that operate on collections.

    Inheritance
    object
    Constraint
    CollectionConstraint
    CollectionItemsEqualConstraint
    CollectionOrderedConstraint
    EmptyCollectionConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    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.DisplayName
    Constraint.Description
    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 abstract class CollectionConstraint : Constraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    CollectionConstraint()

    Construct an empty CollectionConstraint

    Declaration
    protected CollectionConstraint()
    View Source

    CollectionConstraint(object?)

    Construct a CollectionConstraint

    Declaration
    protected CollectionConstraint(object? arg)
    Parameters
    Type Name Description
    object arg

    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

    The value to be tested

    Returns
    Type Description
    ConstraintResult

    True for success, false for failure

    Type Parameters
    Name Description
    TActual
    Overrides
    Constraint.ApplyTo<TActual>(TActual)
    View Source

    IsEmpty(IEnumerable)

    Determines whether the specified enumerable is empty.

    Declaration
    protected static bool IsEmpty(IEnumerable enumerable)
    Parameters
    Type Name Description
    IEnumerable enumerable

    The enumerable.

    Returns
    Type Description
    bool

    true if the specified enumerable is empty; otherwise, false.

    View Source

    Matches(IEnumerable)

    Protected method to be implemented by derived classes

    Declaration
    protected abstract bool Matches(IEnumerable collection)
    Parameters
    Type Name Description
    IEnumerable collection
    Returns
    Type Description
    bool

    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