Class EnumGenerator
Generates enum values in a round-robin fashion.
Inheritance
System.Object
EnumGenerator
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 EnumGenerator : ISpecimenBuilder
Constructors
| Improve this Doc View SourceEnumGenerator()
Initializes a new instance of the EnumGenerator class.
Declaration
public EnumGenerator()
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a new enum value based on a request.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | A context that can be used to create other specimens. Not used. |
Returns
Type | Description |
---|---|
System.Object | An enum value if appropriate; otherwise a NoSpecimen instance. |
Remarks
If request
is a System.Type that represents an enum, an
instance of that enum is returned. Differing values are returned, starting with the
first value. When all values of the enum type have been served, the sequence starts
over again.