Class StringGenerator
Namespace: AutoFixture
Assembly: AutoFixture.dll
Creates string values based on a supplied factory.
public class StringGenerator : ISpecimenBuilderInheritance
Implements
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
StringGenerator(Func<object>)
Initializes a new instance of the StringGenerator class with the supplied
specimen factory.
public StringGenerator(Func<object> specimenFactory)Parameters
A factory that creates a anonymous variables (specimens). The
StringGenerator instance will call ToString on the
created specimen.
Properties
Factory
Gets the factory used to specimens.
public Func<object> Factory { get; }Property Value
See Also
StringGenerator.StringGenerator(Func<object>)
Methods
Create(object, ISpecimenContext)
Creates string specimens by invoking the supplied specimen factory and calling
ToString on the result.
public object Create(object request, ISpecimenContext context)Parameters
request object
The request that describes what to create.
context ISpecimenContext
Not used.
Returns
The string representation of a specimen created by the contained specimen factory.