Class TerminatingWithPathSpecimenBuilder
Decorates an ISpecimenBuilder with a node which tracks specimen requests, and when NoSpecimen is detected or creation fails with exception, throws an ObjectCreationException, which includes a description of the request path.
Inheritance
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class TerminatingWithPathSpecimenBuilder : ISpecimenBuilderNode, ISpecimenBuilder, IEnumerable<ISpecimenBuilder>, IEnumerable
Constructors
| Improve this Doc View SourceTerminatingWithPathSpecimenBuilder(ISpecimenBuilder)
Creates a new TerminatingWithPathSpecimenBuilder instance.
Declaration
public TerminatingWithPathSpecimenBuilder(ISpecimenBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | builder | The specimen builder which creation requests are redirected to. |
Properties
| Improve this Doc View SourceBuilder
Gets the ISpecimenBuilder decorated by this instance.
Declaration
public ISpecimenBuilder Builder { get; }
Property Value
Type | Description |
---|---|
ISpecimenBuilder |
SpecimenRequests
Gets the observed specimen requests, in the order they were requested.
Declaration
public IEnumerable<object> SpecimenRequests { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Object> |
Methods
| Improve this Doc View SourceCompose(IEnumerable<ISpecimenBuilder>)
Composes the supplied builders.
Declaration
public virtual ISpecimenBuilderNode Compose(IEnumerable<ISpecimenBuilder> builders)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ISpecimenBuilder> | builders | The builders to compose. |
Returns
Type | Description |
---|---|
ISpecimenBuilderNode | A new ISpecimenBuilderNode instance containing
|
Create(Object, ISpecimenContext)
Creates a new specimen based on a request by delegating to its decorated builder.
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. |
Returns
Type | Description |
---|---|
System.Object | The requested specimen if possible; otherwise a creation exception is thrown. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<ISpecimenBuilder> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ISpecimenBuilder> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |