Class TaskGenerator

Namespace: AutoFixture
Assembly: AutoFixture.dll

Creates instances of Task and Task%601. The status will be set to RanToCompletion and Result will be resolved by a given ISpecimenContext.

public class TaskGenerator : ISpecimenBuilder

Inheritance

objectTaskGenerator

Implements

ISpecimenBuilder

Inherited Members

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

Extension Methods

SpecimenFactory.Create<T>(ISpecimenBuilder), SpecimenFactory.CreateMany<T>(ISpecimenBuilder), SpecimenFactory.CreateMany<T>(ISpecimenBuilder, int), SpecimenCommand.Do<T>(ISpecimenBuilder, Action<T>), SpecimenCommand.Do<T1, T2>(ISpecimenBuilder, Action<T1, T2>), SpecimenCommand.Do<T1, T2, T3>(ISpecimenBuilder, Action<T1, T2, T3>), SpecimenCommand.Do<T1, T2, T3, T4>(ISpecimenBuilder, Action<T1, T2, T3, T4>), SpecimenQuery.Get<T, TResult>(ISpecimenBuilder, Func<T, TResult>), SpecimenQuery.Get<T1, T2, TResult>(ISpecimenBuilder, Func<T1, T2, TResult>), SpecimenQuery.Get<T1, T2, T3, TResult>(ISpecimenBuilder, Func<T1, T2, T3, TResult>), SpecimenQuery.Get<T1, T2, T3, T4, TResult>(ISpecimenBuilder, Func<T1, T2, T3, T4, TResult>), CustomizationExtensions.ToCustomization(ISpecimenBuilder)

Constructors

TaskGenerator()

public TaskGenerator()

Methods

Create(object, ISpecimenContext)

Creates instances of Task and Task%601. The status will be set to RanToCompletion and Result will be resolved by the context.

public object Create(object request, ISpecimenContext context)

Parameters

request object

The request that describes what to create.

context ISpecimenContext

The context that will be used to resolve the result value for generic tasks.

Returns

object

A task whose status is set to RanToCompletion. If a generic task was requested, its result was resolved from the context.