Class ExactTypeSpecification

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

A specification that evaluates requests for types against a target type. Also matches generic type requests agains the specified open generic.

public class ExactTypeSpecification : IRequestSpecification

Inheritance

objectExactTypeSpecification

Implements

IRequestSpecification

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

ExactTypeSpecification(Type)

Initializes a new instance of the ExactTypeSpecification class.

public ExactTypeSpecification(Type type)

Parameters

type Type

The target type.

Properties

TargetType

Gets the type targeted by this IRequestSpecification.

public Type TargetType { get; }

Property Value

Type

Methods

IsSatisfiedBy(object)

Evaluates a request for a specimen.

public bool IsSatisfiedBy(object request)

Parameters

request object

The specimen request.

Returns

bool

true if request matches the target type; otherwise, false.