Class PropertySpecification
A specification that determines whether the request is a request for a System.Reflection.PropertyInfo matching a particular property, according to the supplied comparison rules.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class PropertySpecification : IRequestSpecification
Constructors
| Improve this Doc View SourcePropertySpecification(IEquatable<PropertyInfo>)
Initializes a new instance of the PropertySpecification class.
Declaration
public PropertySpecification(IEquatable<PropertyInfo> target)
Parameters
Type | Name | Description |
---|---|---|
System.IEquatable<System.Reflection.PropertyInfo> | target | The criterion used to match the requested System.Reflection.PropertyInfo with the specified value. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
PropertySpecification(Type, String)
Initializes a new instance of the PropertySpecification class.
Declaration
public PropertySpecification(Type targetType, string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The System.Type with which the requested System.Reflection.PropertyInfo type should be compatible. |
System.String | targetName | The name which the requested System.Reflection.PropertyInfo name should match exactly. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceTargetName
The name which the requested System.Reflection.PropertyInfo name should match exactly.
Declaration
[Obsolete("This value is only available if the constructor taking a target type and name is used. Otherwise, it'll be null. Use with caution. This property will be removed in a future version of AutoFixture.", true)]
public string TargetName { get; }
Property Value
Type | Description |
---|---|
System.String |
TargetType
The System.Type with which the requested System.Reflection.PropertyInfo type should be compatible.
Declaration
[Obsolete("This value is only available if the constructor taking a target type and name is used. Otherwise, it'll be null. Use with caution. This property will be removed in a future version of AutoFixture.", true)]
public Type TargetType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Methods
| Improve this Doc View SourceIsSatisfiedBy(Object)
Evaluates a request for a specimen.
Declaration
public bool IsSatisfiedBy(object request)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The specimen request. |
Returns
Type | Description |
---|---|
System.Boolean | true if |