Class SubstituteAttributeRelay

Namespace: AutoFixture.AutoNSubstitute
Assembly: AutoFixture.AutoNSubstitute.dll

Relays a request for a code element marked with the SubstituteAttribute to a SubstituteRequest of element's type.

public class SubstituteAttributeRelay : ISpecimenBuilder

Inheritance

objectSubstituteAttributeRelay

Implements

ISpecimenBuilder

Inherited Members

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

Constructors

SubstituteAttributeRelay()

public SubstituteAttributeRelay()

Methods

Create(object, ISpecimenContext)

Creates a relayed request based on the SubstituteAttribute applied to a code element and resolves it from the given context.

public object Create(object request, ISpecimenContext context)

Parameters

request object

context ISpecimenContext

Returns

object

A specimen resolved from the context based on a relayed request. If the request code element does not have SubstituteAttribute applied, returns NoSpecimen.