Class AnyOfConstraint
AnyOfConstraint is used to determine whether the value is equal to any of the expected values.
Inheritance
AnyOfConstraint
Assembly: nunit.framework.dll
Syntax
public class AnyOfConstraint : Constraint, IConstraint, IResolveConstraint
Constructors
View Source
AnyOfConstraint(ICollection)
Declaration
public AnyOfConstraint(ICollection expected)
Parameters
Type |
Name |
Description |
ICollection |
expected |
Collection of expected values
|
Properties
View Source
Description
The Description of what this constraint tests, for
use in messages and in the ConstraintResult.
Declaration
public override string Description { get; }
Property Value
Overrides
View Source
IgnoreCase
Flag the constraint to ignore case and return self.
Declaration
public AnyOfConstraint IgnoreCase { get; }
Property Value
View Source
IgnoreWhiteSpace
Flag the constraint to ignore white space and return self.
Declaration
public AnyOfConstraint IgnoreWhiteSpace { get; }
Property Value
Methods
View Source
ApplyTo<TActual>(TActual)
Test whether item is present in expected collection
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
Type |
Name |
Description |
TActual |
actual |
Actual item
|
Returns
Type Parameters
Name |
Description |
TActual |
Actual item type
|
Overrides
View Source
GetStringRepresentation()
Returns the string representation of this constraint
Declaration
protected override string GetStringRepresentation()
Returns
Overrides
View Source
Using(IComparer)
Flag the constraint to use the supplied IComparer object.
Declaration
public AnyOfConstraint Using(IComparer comparer)
Parameters
Type |
Name |
Description |
IComparer |
comparer |
The IComparer object to use.
|
Returns
View Source
Using(IEqualityComparer)
Flag the constraint to use the supplied IEqualityComparer object.
Declaration
public AnyOfConstraint Using(IEqualityComparer comparer)
Parameters
Type |
Name |
Description |
IEqualityComparer |
comparer |
The IEqualityComparer object to use.
|
Returns
View Source
UsingPropertiesComparer()
Enables comparing of instance properties.
Declaration
public AnyOfConstraint UsingPropertiesComparer()
Returns
View Source
Using<T>(IComparer<T>)
Flag the constraint to use the supplied IComparer object.
Declaration
public AnyOfConstraint Using<T>(IComparer<T> comparer)
Parameters
Type |
Name |
Description |
IComparer<T> |
comparer |
The IComparer object to use.
|
Returns
Type Parameters
View Source
Using<T>(IEqualityComparer<T>)
Flag the constraint to use the supplied IEqualityComparer object.
Declaration
public AnyOfConstraint Using<T>(IEqualityComparer<T> comparer)
Parameters
Returns
Type Parameters
View Source
Using<T>(Comparison<T>)
Flag the constraint to use the supplied Comparison object.
Declaration
public AnyOfConstraint Using<T>(Comparison<T> comparer)
Parameters
Type |
Name |
Description |
Comparison<T> |
comparer |
The Comparison object to use.
|
Returns
Type Parameters
View Source
Using<T>(Func<T, T, bool>)
Flag the constraint to use the supplied boolean-returning delegate.
Declaration
public AnyOfConstraint Using<T>(Func<T, T, bool> comparer)
Parameters
Type |
Name |
Description |
Func<T, T, bool> |
comparer |
The supplied boolean-returning delegate to use.
|
Returns
Type Parameters
Implements