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