Class EqualUsingConstraint<T>
EqualUsingConstraint where the comparison is done by a user supplied comparer.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class EqualUsingConstraint<T> : Constraint, IConstraint, IResolveConstraint
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
View SourceEqualUsingConstraint(T?, IComparer<T>)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, IComparer<T> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| IComparer<T> | comparer | The comparer to use. |
EqualUsingConstraint(T?, IEqualityComparer<T>)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, IEqualityComparer<T> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| IEqualityComparer<T> | comparer | The comparer to use. |
EqualUsingConstraint(T?, IComparer)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, IComparer comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| IComparer | comparer | The comparer to use. |
EqualUsingConstraint(T?, IEqualityComparer)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, IEqualityComparer comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| IEqualityComparer | comparer | The comparer to use. |
EqualUsingConstraint(T?, Comparison<T>)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, Comparison<T> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| Comparison<T> | comparer | The comparer to use. |
EqualUsingConstraint(T?, Func<object, object, bool>)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, Func<object, object, bool> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| Func<object, object, bool> | comparer | The comparer to use. |
EqualUsingConstraint(T?, Func<T, T, bool>)
Initializes a new instance of the EqualConstraint class.
Declaration
public EqualUsingConstraint(T? expected, Func<T, T, bool> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| T | expected | The expected value. |
| Func<T, T, bool> | comparer | The comparer to use. |
Properties
View SourceDescription
The Description of what this constraint tests, for use in messages and in the ConstraintResult.
Declaration
public override string Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
View SourceApplyTo(T?)
Test whether the constraint is satisfied by a given value
Declaration
public virtual ConstraintResult ApplyTo(T? actual)
Parameters
| Type | Name | Description |
|---|---|---|
| T | actual | The value to be tested |
Returns
| Type | Description |
|---|---|
| ConstraintResult | True for success, false for failure |
ApplyTo<TActual>(TActual)
Applies the constraint to an actual value, returning a ConstraintResult.
Declaration
public override sealed ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
| Type | Name | Description |
|---|---|---|
| TActual | actual | The value to be tested |
Returns
| Type | Description |
|---|---|
| ConstraintResult | A ConstraintResult |
Type Parameters
| Name | Description |
|---|---|
| TActual |
Overrides
Remarks
I wish we could hide this method, but it is public in the base class.