Class UnwrapMemberRequest
If member request (e.g. PropertyInfo, FieldInfo, ParameterInfo) is passed, extracts the member type and uses the inner Builder to resolve request value.
Inheritance
System.Object
UnwrapMemberRequest
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AutoFixture
Assembly: AutoFixture.dll
Syntax
public class UnwrapMemberRequest : ISpecimenBuilder
Constructors
| Improve this Doc View SourceUnwrapMemberRequest(ISpecimenBuilder)
Creates a new instance of UnwrapMemberRequest.
Declaration
public UnwrapMemberRequest(ISpecimenBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | builder |
Properties
| Improve this Doc View SourceBuilder
Builder used to resolve the unwrapped member request.
Declaration
public ISpecimenBuilder Builder { get; }
Property Value
Type | Description |
---|---|
ISpecimenBuilder |
MemberTypeResolver
Gets or sets resolver used to extract member type.
Declaration
public IRequestMemberTypeResolver MemberTypeResolver { get; set; }
Property Value
Type | Description |
---|---|
IRequestMemberTypeResolver |
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a new specimen based on a request.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | A context that can be used to create other specimens. |
Returns
Type | Description |
---|---|
System.Object | The requested specimen if possible; otherwise a NoSpecimen instance. |
Remarks
The request
can be any object, but will often be a
System.Type or other System.Reflection.MemberInfo instances.
Note to implementers: Implementations are expected to return a NoSpecimen instance if they can't satisfy the request.