Class FieldTypeAndNameCriterion
Represents a criterion for comparing a candidate field against a desired type and name.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class FieldTypeAndNameCriterion : IEquatable<FieldInfo>
Remarks
Sometimes, you may need to evaluate various candidate System.Reflection.FieldInfo values, looking for one that has a desired field type and name. This class represents such an evaluation criterion.
Constructors
| Improve this Doc View SourceFieldTypeAndNameCriterion(IEquatable<Type>, IEquatable<String>)
Initializes a new instance of the FieldTypeAndNameCriterion class with the desired field type and name criteria.
Declaration
public FieldTypeAndNameCriterion(IEquatable<Type> typeCriterion, IEquatable<string> nameCriterion)
Parameters
Type | Name | Description |
---|---|---|
System.IEquatable<System.Type> | typeCriterion | The criterion indicating the desired field type. |
System.IEquatable<System.String> | nameCriterion | The criterion indicating the desired field name. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceNameCriterion
The name criterion originally passed in via the class' constructor.
Declaration
public IEquatable<string> NameCriterion { get; }
Property Value
Type | Description |
---|---|
System.IEquatable<System.String> |
TypeCriterion
The type criterion originally passed in via the class' constructor.
Declaration
public IEquatable<Type> TypeCriterion { get; }
Property Value
Type | Description |
---|---|
System.IEquatable<System.Type> |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether this object is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare to this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Overrides
Equals(FieldInfo)
Compares a candidate System.Reflection.FieldInfo object against this FieldTypeAndNameCriterion.
Declaration
public bool Equals(FieldInfo other)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | other | The candidate to compare against this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Remarks
This method compares the candidate other
against TypeCriterion and
NameCriterion. If the field's type matches the type
criterion, and its name matches the name criterion, the return
value is true.
GetHashCode()
Returns the hash code for the object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code. |