Class ElementsBuilder<T>
Draws a random element from the given collection.
Inheritance
System.Object
ElementsBuilder<T>
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 sealed class ElementsBuilder<T> : ISpecimenBuilder
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceElementsBuilder(T[])
Initializes a new instance of the ElementsBuilder<T> class.
Declaration
public ElementsBuilder(params T[] elements)
Parameters
Type | Name | Description |
---|---|---|
T[] | elements |
ElementsBuilder(IEnumerable<T>)
Initializes a new instance of the ElementsBuilder<T> class.
Declaration
public ElementsBuilder(IEnumerable<T> elements)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | elements |
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Returns one of the element present in the collection given when the object was constructed.
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 | One of the element present in the collection given to the constructor if |