Class AutoFixtureValuesHandler

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

CallHandler for NSubstitute to provide auto-values from AutoFixture. It resolves return values and sets ref/out parameter values obtained from ICallResultResolver. Uses cache to resolve value only once per call with specified args.

public class AutoFixtureValuesHandler : ICallHandler

Inheritance

objectAutoFixtureValuesHandler

Implements

ICallHandler

Inherited Members

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

Constructors

AutoFixtureValuesHandler(ICallResultResolver, ICallResultCache, ICallSpecificationFactory)

Initializes a new instance of AutoFixtureValuesHandler with related specimen context, results cache and specification factory.

public AutoFixtureValuesHandler(ICallResultResolver resultResolver, ICallResultCache resultCache, ICallSpecificationFactory callSpecificationFactory)

Parameters

resultResolver ICallResultResolver

resultCache ICallResultCache

callSpecificationFactory ICallSpecificationFactory

Properties

CallSpecificationFactory

Factory for the ICallSpecification instances used as a cache key.

public ICallSpecificationFactory CallSpecificationFactory { get; }

Property Value

ICallSpecificationFactory

ResultCache

Cache used to store the already resolved call results.

public ICallResultCache ResultCache { get; }

Property Value

ICallResultCache

ResultResolver

Resolver used to obtain call result if not present in cache.

public ICallResultResolver ResultResolver { get; }

Property Value

ICallResultResolver

Methods

Handle(ICall)

Try to handle the call - set ref/out params and return value.

public RouteAction Handle(ICall call)

Parameters

call ICall

Returns

RouteAction