C# Класс AutoFixture.Kernel.Criterion

Serves as a criterion against which a value can be compared. When a given value equals the criterion, it can be said to match the criterion; otherwise not.

Sometimes you need to compare various candidates against a particular value, but the comparison rules may vary. Sometimes, strict equality is warranted, but otherwise (e.g. when comparing strings) looser comparison rules can be applied (e.g. case-insensitve comparison of strings).

The Criterion class enables you to capture the desied value (the Target) together with the appropriate comparison method (the Comparer) in a single object.

Наследование: IEquatable
Показать файл Открыть проект

Открытые методы

Метод Описание
Criterion ( target, IEqualityComparer comparer ) : System

Initializes a new instance of the Criterion{T} class.

Equals ( other ) : bool

Compares a candidate value against this Criterion{T}.

This method compares the candidate other against Target, using Comparer as the comparison method. If this combination of target value and comparison method deems the candidate to be equal to this criterion, the return value is .

Equals ( object obj ) : bool

Determines whether this object is equal to another object.

GetHashCode ( ) : int

Returns the hash code for the object.

Описание методов

Criterion() публичный Метод

Initializes a new instance of the Criterion{T} class.
/// is . ///
public Criterion ( target, IEqualityComparer comparer ) : System
target /// The target value against which candidates will be compared. Can be /// . ///
comparer IEqualityComparer /// The comparison method used to compare candidates against /// . ///
Результат System

Equals() публичный Метод

Compares a candidate value against this Criterion{T}.

This method compares the candidate other against Target, using Comparer as the comparison method. If this combination of target value and comparison method deems the candidate to be equal to this criterion, the return value is .

public Equals ( other ) : bool
other /// The candidate to compare against this value. ///
Результат bool

Equals() публичный Метод

Determines whether this object is equal to another object.
public Equals ( object obj ) : bool
obj object The object to compare to this object.
Результат bool

GetHashCode() публичный Метод

Returns the hash code for the object.
public GetHashCode ( ) : int
Результат int