Class StringGenerator
Creates string values based on a supplied factory.
Inheritance
System.Object
StringGenerator
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AutoFixture
Assembly: AutoFixture.dll
Syntax
public class StringGenerator : ISpecimenBuilder
Constructors
| Improve this Doc View SourceStringGenerator(Func<Object>)
Initializes a new instance of the StringGenerator class with the supplied specimen factory.
Declaration
public StringGenerator(Func<object> specimenFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Object> | specimenFactory | A factory that creates a anonymous variables (specimens). The StringGenerator instance will call System.Object.ToString() on the created specimen. |
Properties
| Improve this Doc View SourceFactory
Gets the factory used to specimens.
Declaration
public Func<object> Factory { get; }
Property Value
Type | Description |
---|---|
System.Func<System.Object> |
See Also
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates string specimens by invoking the supplied specimen factory and calling System.Object.ToString() on the result.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | Not used. |
Returns
Type | Description |
---|---|
System.Object | The string representation of a specimen created by the contained specimen factory. |