Class PropertySpecification
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
A specification that determines whether the request is a request
for a PropertyInfo matching a particular property,
according to the supplied comparison rules.
public class PropertySpecification : IRequestSpecificationInheritance
object ← PropertySpecification
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
PropertySpecification(Type, string)
Initializes a new instance of the PropertySpecification class.
public PropertySpecification(Type targetType, string targetName)Parameters
targetType Type
The Type with which the requested
PropertyInfo type should be compatible.
targetName string
The name which the requested PropertyInfo name
should match exactly.
Exceptions
targetType or
targetName is null.
PropertySpecification(IEquatable<PropertyInfo>)
Initializes a new instance of the
PropertySpecification class.
public PropertySpecification(IEquatable<PropertyInfo> target)Parameters
target IEquatable<PropertyInfo>
The criterion used to match the requested
PropertyInfo with the specified value.
Exceptions
target is null.
Methods
IsSatisfiedBy(object)
Evaluates a request for a specimen.
public bool IsSatisfiedBy(object request)Parameters
request object
The specimen request.
Returns
true if request is satisfied by the Specification;
otherwise, false.