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
파일 보기 프로젝트 열기: nxzzkj/lazyiot

공개 메소드들

메소드 설명
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