Class FieldSpecification
A specification that determines whether the request is a request for a System.Reflection.FieldInfo matching the specified name and System.Type.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class FieldSpecification : IRequestSpecification
Constructors
| Improve this Doc View SourceFieldSpecification(IEquatable<FieldInfo>)
Initializes a new instance of the FieldSpecification class.
Declaration
public FieldSpecification(IEquatable<FieldInfo> target)
Parameters
Type | Name | Description |
---|---|---|
System.IEquatable<System.Reflection.FieldInfo> | target | The criteria used to match the requested System.Reflection.FieldInfo. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
FieldSpecification(Type, String)
Initializes a new instance of the FieldSpecification class.
Declaration
public FieldSpecification(Type targetType, string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The System.Type with which the requested System.Reflection.FieldInfo type should be compatible. |
System.String | targetName | The name which the requested System.Reflection.FieldInfo name should match exactly. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceTargetName
The name which the requested System.Reflection.FieldInfo 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.FieldInfo 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 |