Class TraceWriter
Trace writer that will write out a trace of object requests and created objects in the ISpecimenBuilder pipeline.
Inheritance
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class TraceWriter : ISpecimenBuilderNode, ISpecimenBuilder, IEnumerable<ISpecimenBuilder>, IEnumerable
Constructors
| Improve this Doc View SourceTraceWriter(TextWriter, TracingBuilder)
Initializes a new instance of the TraceWriter class.
Declaration
public TraceWriter(TextWriter writer, TracingBuilder tracer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | writer | The output stream for the trace. |
TracingBuilder | tracer | The ISpecimenBuilder to decorate. |
Properties
| Improve this Doc View SourceTracer
Gets the TracingBuilder decorated by this instance.
Declaration
public TracingBuilder Tracer { get; }
Property Value
Type | Description |
---|---|
TracingBuilder |
TraceRequestFormatter
Gets or sets the formatter for tracing a request.
Declaration
public Action<TextWriter, object, int> TraceRequestFormatter { get; set; }
Property Value
Type | Description |
---|---|
System.Action<System.IO.TextWriter, System.Object, System.Int32> | The request trace formatter. |
TraceSpecimenFormatter
Gets or sets the formatter for tracing a created specimen.
Declaration
public Action<TextWriter, object, int> TraceSpecimenFormatter { get; set; }
Property Value
Type | Description |
---|---|
System.Action<System.IO.TextWriter, System.Object, System.Int32> | The created specimen trace formatter. |
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 NoSpecimen instance. |
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 |