Class DisposableTrackingBehavior
Decorates ISpecimenBuilder instances with DisposableTracker instances.
Inheritance
System.Object
DisposableTrackingBehavior
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.Kernel
Assembly: AutoFixture.dll
Syntax
public class DisposableTrackingBehavior : ISpecimenBuilderTransformation, IDisposable
Constructors
| Improve this Doc View SourceDisposableTrackingBehavior()
Initializes a new instance of the DisposableTrackingBehavior class.
Declaration
public DisposableTrackingBehavior()
Properties
| Improve this Doc View SourceTrackers
Gets the trackers created by this instance. Each time Transform(ISpecimenBuilder) is invoked, a new DisposableTracker instance is created and added to this list.
Declaration
public IEnumerable<DisposableTracker> Trackers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DisposableTracker> |
Methods
| Improve this Doc View SourceDispose()
Disposes all Trackers and clears the list.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all Trackers and clears the list.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Transform(ISpecimenBuilder)
Decorates the supplied builder with a DisposableTracker.
Declaration
public ISpecimenBuilderNode Transform(ISpecimenBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | builder | The builder to transform. |
Returns
Type | Description |
---|---|
ISpecimenBuilderNode | A new DisposableTracker that decorates |
Remarks
The returned DisposableTracker is also added to the Trackers property.
Implements
System.IDisposable