Search Results for

    Show / Hide Table of Contents

    Class CollectionItemsEqualConstraint

    CollectionItemsEqualConstraint is the abstract base class for all collection constraints that apply some notion of item equality as a part of their operation.

    Inheritance
    object
    Constraint
    CollectionConstraint
    CollectionItemsEqualConstraint
    CollectionEquivalentConstraint
    CollectionSubsetConstraint
    CollectionSupersetConstraint
    DictionaryContainsKeyConstraint
    DictionaryContainsKeyValuePairConstraint
    DictionaryContainsValueConstraint
    UniqueItemsConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    CollectionConstraint.IsEmpty(IEnumerable)
    CollectionConstraint.ApplyTo<TActual>(TActual)
    CollectionConstraint.Matches(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.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 CollectionItemsEqualConstraint : CollectionConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    CollectionItemsEqualConstraint()

    Construct an empty CollectionConstraint

    Declaration
    protected CollectionItemsEqualConstraint()
    View Source

    CollectionItemsEqualConstraint(object?)

    Construct a CollectionConstraint

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

    Properties

    View Source

    IgnoreCase

    Flag the constraint to ignore case and return self.

    Declaration
    public CollectionItemsEqualConstraint IgnoreCase { get; }
    Property Value
    Type Description
    CollectionItemsEqualConstraint
    View Source

    IgnoreWhiteSpace

    Flag the constraint to ignore white space and return self.

    Declaration
    public CollectionItemsEqualConstraint IgnoreWhiteSpace { get; }
    Property Value
    Type Description
    CollectionItemsEqualConstraint
    View Source

    IgnoringCase

    Get a flag indicating whether the user requested us to ignore case.

    Declaration
    protected bool IgnoringCase { get; }
    Property Value
    Type Description
    bool
    View Source

    IgnoringWhiteSpace

    Get a flag indicating whether the user requested us to ignore white space.

    Declaration
    protected bool IgnoringWhiteSpace { get; }
    Property Value
    Type Description
    bool
    View Source

    UsingExternalComparer

    Get a flag indicating whether any external comparers are in use.

    Declaration
    protected bool UsingExternalComparer { get; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    ItemsEqual(object?, object?)

    Compares two collection members for equality

    Declaration
    protected bool ItemsEqual(object? x, object? y)
    Parameters
    Type Name Description
    object x
    object y
    Returns
    Type Description
    bool
    View Source

    Tally(IEnumerable)

    Return a new CollectionTally for use in making tests

    Declaration
    protected CollectionTally Tally(IEnumerable c)
    Parameters
    Type Name Description
    IEnumerable c

    The collection to be included in the tally

    Returns
    Type Description
    CollectionTally
    View Source

    Using(IComparer)

    Flag the constraint to use the supplied IComparer object.

    Declaration
    public CollectionItemsEqualConstraint Using(IComparer comparer)
    Parameters
    Type Name Description
    IComparer comparer

    The IComparer object to use.

    Returns
    Type Description
    CollectionItemsEqualConstraint
    View Source

    Using(IEqualityComparer)

    Flag the constraint to use the supplied IEqualityComparer object.

    Declaration
    public CollectionItemsEqualConstraint Using(IEqualityComparer comparer)
    Parameters
    Type Name Description
    IEqualityComparer comparer

    The IComparer object to use.

    Returns
    Type Description
    CollectionItemsEqualConstraint
    View Source

    UsingPropertiesComparer()

    Enables comparing of instance properties.

    Declaration
    public CollectionItemsEqualConstraint UsingPropertiesComparer()
    Returns
    Type Description
    CollectionItemsEqualConstraint
    Remarks

    This allows comparing classes that don't implement IEquatable<T> without having to compare each property separately in own code.

    View Source

    Using<T>(IComparer<T>)

    Flag the constraint to use the supplied IComparer object.

    Declaration
    public CollectionItemsEqualConstraint Using<T>(IComparer<T> comparer)
    Parameters
    Type Name Description
    IComparer<T> comparer

    The IComparer object to use.

    Returns
    Type Description
    CollectionItemsEqualConstraint
    Type Parameters
    Name Description
    T
    View Source

    Using<T>(IEqualityComparer<T>)

    Flag the constraint to use the supplied IEqualityComparer object.

    Declaration
    public CollectionItemsEqualConstraint Using<T>(IEqualityComparer<T> comparer)
    Parameters
    Type Name Description
    IEqualityComparer<T> comparer

    The IComparer object to use.

    Returns
    Type Description
    CollectionItemsEqualConstraint
    Type Parameters
    Name Description
    T
    View Source

    Using<T>(Comparison<T>)

    Flag the constraint to use the supplied Comparison object.

    Declaration
    public CollectionItemsEqualConstraint Using<T>(Comparison<T> comparison)
    Parameters
    Type Name Description
    Comparison<T> comparison

    The Comparison object to use.

    Returns
    Type Description
    CollectionItemsEqualConstraint
    Type Parameters
    Name Description
    T
    View Source

    Using<T>(Func<T, T, bool>)

    Flag the constraint to use the supplied boolean-returning delegate.

    Declaration
    public CollectionItemsEqualConstraint Using<T>(Func<T, T, bool> comparer)
    Parameters
    Type Name Description
    Func<T, T, bool> comparer

    The supplied boolean-returning delegate to use.

    Returns
    Type Description
    CollectionItemsEqualConstraint
    Type Parameters
    Name Description
    T

    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