Class Generator<T>
Generates a perpetual sequence of items.
Inheritance
System.Object
Generator<T>
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
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 Generator<T> : IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | The item type. |
Remarks
This is a generator that generates a perpetual sequence of items of
type T
, based on an encapsulated
ISpecimenBuilder. This can be useful when zipping a
against a finite sequence, since this sequence will go on for as long
as required.
Constructors
| Improve this Doc View SourceGenerator(ISpecimenBuilder)
Initializes a new instance of the Generator<T> class.
Declaration
public Generator(ISpecimenBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | builder | A builder which is used to generate items. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Methods
| Improve this Doc View SourceGetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<T> |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable