Class PropertyTypeAndNameCriterion
Represents a criterion for comparing a candidate property against a desired type and name.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class PropertyTypeAndNameCriterion : IEquatable<PropertyInfo>
Remarks
Sometimes, you may need to evaluate various candidate System.Reflection.PropertyInfo values, looking for one that has a desired property type and name. This class represents such an evaluation criterion.
Constructors
| Improve this Doc View SourcePropertyTypeAndNameCriterion(IEquatable<Type>, IEquatable<String>)
Initializes a new instance of the PropertyTypeAndNameCriterion class with the desired field type and name criteria.
Declaration
public PropertyTypeAndNameCriterion(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(PropertyInfo)
Compares a candidate System.Reflection.PropertyInfo object against this FieldTypeAndNameCriterion.
Declaration
public bool Equals(PropertyInfo other)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | 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 property'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. |