IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Constraints.NUnitEqualityComparer Class Reference

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

+ Collaboration diagram for NUnit.Framework.Constraints.NUnitEqualityComparer:

Classes

class  FailurePoint
 FailurePoint class represents one point of failure in an equality test. More...
 

Public Member Functions

bool AreEqual (object x, object y, ref Tolerance tolerance)
 Compares two objects for equality within a tolerance. More...
 

Properties

static NUnitEqualityComparer Default [get]
 Returns the default NUnitEqualityComparer More...
 
bool IgnoreCase [get, set]
 Gets and sets a flag indicating whether case should be ignored in determining equality. More...
 
bool CompareAsCollection [get, set]
 Gets and sets a flag indicating that arrays should be compared as collections, without regard to their shape. More...
 
IList< EqualityAdapterExternalComparers [get]
 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. More...
 
IList< FailurePointFailurePoints [get]
 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. More...
 
bool WithSameOffset [get, set]
 Flags the comparer to include DateTimeOffset.Offset property in comparison of two DateTimeOffset values. More...
 

Private Member Functions

EqualityAdapter GetExternalComparer (object x, object y)
 
bool ArraysEqual (Array x, Array y, ref Tolerance tolerance)
 Helper method to compare two arrays More...
 
bool DictionariesEqual (IDictionary x, IDictionary y, ref Tolerance tolerance)
 
bool DictionaryEntriesEqual (DictionaryEntry x, DictionaryEntry y, ref Tolerance tolerance)
 
bool CollectionsEqual (ICollection x, ICollection y, ref Tolerance tolerance)
 
bool StringsEqual (string x, string y)
 
bool CharsEqual (char x, char y)
 
bool EnumerablesEqual (IEnumerable x, IEnumerable y, ref Tolerance tolerance)
 
bool StreamsEqual (Stream x, Stream y)
 

Static Private Member Functions

static bool FirstImplementsIEquatableOfSecond (Type first, Type second)
 
static IList< Type > GetEquatableGenericArguments (Type type)
 
static bool InvokeFirstIEquatableEqualsSecond (object first, object second)
 
static MethodInfo GetCorrectGenericEqualsMethod (Type first, Type second)
 
static bool DirectoriesEqual (DirectoryInfo x, DirectoryInfo y)
 Method to compare two DirectoryInfo objects More...
 

Private Attributes

bool caseInsensitive
 If true, all string comparisons will ignore case More...
 
bool compareAsCollection
 If true, arrays will be treated as collections, allowing those of different dimensions to be compared More...
 
List< EqualityAdapterexternalComparers = new List<EqualityAdapter>()
 Comparison objects used in comparisons for some constraints. More...
 
List< FailurePointfailurePoints
 List of points at which a failure occurred. More...
 

Static Private Attributes

static readonly int BUFFER_SIZE = 4096
 

Detailed Description

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

Member Function Documentation

static bool NUnit.Framework.Constraints.NUnitEqualityComparer.FirstImplementsIEquatableOfSecond ( Type  first,
Type  second 
)
inlinestaticprivate
static IList<Type> NUnit.Framework.Constraints.NUnitEqualityComparer.GetEquatableGenericArguments ( Type  type)
inlinestaticprivate
static bool NUnit.Framework.Constraints.NUnitEqualityComparer.InvokeFirstIEquatableEqualsSecond ( object  first,
object  second 
)
inlinestaticprivate
static MethodInfo NUnit.Framework.Constraints.NUnitEqualityComparer.GetCorrectGenericEqualsMethod ( Type  first,
Type  second 
)
inlinestaticprivate
EqualityAdapter NUnit.Framework.Constraints.NUnitEqualityComparer.GetExternalComparer ( object  x,
object  y 
)
inlineprivate
bool NUnit.Framework.Constraints.NUnitEqualityComparer.ArraysEqual ( Array  x,
Array  y,
ref Tolerance  tolerance 
)
inlineprivate

Helper method to compare two arrays

bool NUnit.Framework.Constraints.NUnitEqualityComparer.DictionariesEqual ( IDictionary  x,
IDictionary  y,
ref Tolerance  tolerance 
)
inlineprivate
bool NUnit.Framework.Constraints.NUnitEqualityComparer.DictionaryEntriesEqual ( DictionaryEntry  x,
DictionaryEntry  y,
ref Tolerance  tolerance 
)
inlineprivate
bool NUnit.Framework.Constraints.NUnitEqualityComparer.StringsEqual ( string  x,
string  y 
)
inlineprivate
bool NUnit.Framework.Constraints.NUnitEqualityComparer.CharsEqual ( char  x,
char  y 
)
inlineprivate
static bool NUnit.Framework.Constraints.NUnitEqualityComparer.DirectoriesEqual ( DirectoryInfo  x,
DirectoryInfo  y 
)
inlinestaticprivate

Method to compare two DirectoryInfo objects

Parameters
xfirst directory to compare
ysecond directory to compare
Returns
true if equivalent, false if not

Member Data Documentation

bool NUnit.Framework.Constraints.NUnitEqualityComparer.caseInsensitive
private

If true, all string comparisons will ignore case

bool NUnit.Framework.Constraints.NUnitEqualityComparer.compareAsCollection
private

If true, arrays will be treated as collections, allowing those of different dimensions to be compared

List<EqualityAdapter> NUnit.Framework.Constraints.NUnitEqualityComparer.externalComparers = new List<EqualityAdapter>()
private

Comparison objects used in comparisons for some constraints.

List<FailurePoint> NUnit.Framework.Constraints.NUnitEqualityComparer.failurePoints
private

List of points at which a failure occurred.

readonly int NUnit.Framework.Constraints.NUnitEqualityComparer.BUFFER_SIZE = 4096
staticprivate

Property Documentation

NUnitEqualityComparer NUnit.Framework.Constraints.NUnitEqualityComparer.Default
staticget

Returns the default NUnitEqualityComparer

bool NUnit.Framework.Constraints.NUnitEqualityComparer.IgnoreCase
getset

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

bool NUnit.Framework.Constraints.NUnitEqualityComparer.CompareAsCollection
getset

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

IList<EqualityAdapter> NUnit.Framework.Constraints.NUnitEqualityComparer.ExternalComparers
get

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.

Referenced by NUnit.Framework.Constraints.EqualConstraint.Using(), and NUnit.Framework.Constraints.EqualConstraint.Using< T >().

IList<FailurePoint> NUnit.Framework.Constraints.NUnitEqualityComparer.FailurePoints
get

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.

bool NUnit.Framework.Constraints.NUnitEqualityComparer.WithSameOffset
getset

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

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


The documentation for this class was generated from the following file: