Class EqualityAdapter
Inheritance
EqualityAdapter
Assembly: nunit.framework.dll
Syntax
public abstract class EqualityAdapter
Constructors
View Source
EqualityAdapter()
Declaration
protected EqualityAdapter()
Methods
View Source
AreEqual(object, object)
Compares two objects, returning true if they are equal
Declaration
public abstract bool AreEqual(object x, object y)
Parameters
Returns
View Source
AreEqual(object, object, ref Tolerance)
Compares two objects, within a tolerance returning true if they are equal
Declaration
public virtual bool AreEqual(object x, object y, ref Tolerance tolerance)
Parameters
Returns
View Source
CanCompare(object, object)
Returns true if the two objects can be compared by this adapter.
The base adapter cannot handle IEnumerables except for strings.
Declaration
public virtual bool CanCompare(object x, object y)
Parameters
Returns
View Source
For(IComparer)
Declaration
public static EqualityAdapter For(IComparer comparer)
Parameters
Returns
View Source
For(IEqualityComparer)
Declaration
public static EqualityAdapter For(IEqualityComparer comparer)
Parameters
Returns
View Source
For<T>(IComparer<T>)
Declaration
public static EqualityAdapter For<T>(IComparer<T> comparer)
Parameters
Returns
Type Parameters
View Source
For<T>(IEqualityComparer<T>)
Declaration
public static EqualityAdapter For<T>(IEqualityComparer<T> comparer)
Parameters
Returns
Type Parameters
View Source
For<T>(Comparison<T>)
Declaration
public static EqualityAdapter For<T>(Comparison<T> comparer)
Parameters
Returns
Type Parameters
View Source
For<TExpected, TActual>(Func<TExpected, TActual, bool>)
Returns an EqualityAdapter that uses a predicate function for items comparison.
Declaration
public static EqualityAdapter For<TExpected, TActual>(Func<TExpected, TActual, bool> comparison)
Parameters
Type |
Name |
Description |
Func<TExpected, TActual, bool> |
comparison |
|
Returns
Type Parameters
Name |
Description |
TExpected |
|
TActual |
|