Search Results for

    Show / Hide Table of Contents

    Class NUnitEqualityComparer

    NUnitEqualityComparer encapsulates NUnit's handling of equality tests between objects.

    Inheritance
    object
    NUnitEqualityComparer
    Inherited Members
    object.GetType()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public sealed class NUnitEqualityComparer

    Constructors

    View Source

    NUnitEqualityComparer()

    Initializes a new instance of the NUnitEqualityComparer class.

    Declaration
    public NUnitEqualityComparer()

    Properties

    View Source

    CompareAsCollection

    Gets and sets a flag indicating that arrays should be compared as collections, without regard to their shape.

    Declaration
    public bool CompareAsCollection { get; set; }
    Property Value
    Type Description
    bool
    View Source

    CompareProperties

    Gets and sets a flag indicating whether an instance properties should be compared when determining equality.

    Declaration
    public bool CompareProperties { get; set; }
    Property Value
    Type Description
    bool
    View Source

    ExternalComparers

    Gets the list of external comparers to be used to test for equality. They are applied to members of collections, in place of NUnit's own logic.

    Declaration
    public IList<EqualityAdapter> ExternalComparers { get; }
    Property Value
    Type Description
    IList<EqualityAdapter>
    View Source

    FailurePoints

    Gets the list of failure points for the last Match performed. The list consists of objects to be interpreted by the caller. This generally means that the caller may only make use of objects it has placed on the list at a particular depth.

    Declaration
    public IList<NUnitEqualityComparer.FailurePoint> FailurePoints { get; }
    Property Value
    Type Description
    IList<NUnitEqualityComparer.FailurePoint>
    View Source

    HasFailurePoints

    Gets a value indicating whether there is any additional Failure Information.

    Declaration
    public bool HasFailurePoints { get; }
    Property Value
    Type Description
    bool
    View Source

    IgnoreCase

    Gets and sets a flag indicating whether case should be ignored in determining equality.

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

    IgnoreWhiteSpace

    Gets and sets a flag indicating whether white space should be ignored in determining equality.

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

    WithSameOffset

    Flags the comparer to include Offset property in comparison of two DateTimeOffset values.

    Declaration
    public bool WithSameOffset { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Using this modifier does not allow to use the Tolerance modifier.

    Methods

    View Source

    AreEqual(object?, object?, ref Tolerance)

    Compares two objects for equality within a tolerance.

    Declaration
    public bool AreEqual(object? x, object? y, ref Tolerance tolerance)
    Parameters
    Type Name Description
    object x
    object y
    Tolerance tolerance
    Returns
    Type Description
    bool
    • 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