Table of Contents

Class NUnitEqualityComparer

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

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

public class NUnitEqualityComparer
Inheritance
NUnitEqualityComparer
Inherited Members

Constructors

NUnitEqualityComparer()

public NUnitEqualityComparer()

Properties

CompareAsCollection

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

public bool CompareAsCollection { get; set; }

Property Value

bool

Default

Returns the default NUnitEqualityComparer

public static NUnitEqualityComparer Default { get; }

Property Value

NUnitEqualityComparer

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.

public IList<EqualityAdapter> ExternalComparers { get; }

Property Value

IList<EqualityAdapter>

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 depthy.

public IList<NUnitEqualityComparer.FailurePoint> FailurePoints { get; }

Property Value

IList<NUnitEqualityComparer.FailurePoint>

IgnoreCase

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

public bool IgnoreCase { get; set; }

Property Value

bool

Methods

AreEqual(object, object, ref Tolerance)

Compares two objects for equality within a tolerance.

public bool AreEqual(object x, object y, ref Tolerance tolerance)

Parameters

x object
y object
tolerance Tolerance

Returns

bool