Class ThrowingRecursionGuard
Handles recursion in the specimen creation process by throwing an exception at recursion point.
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
[Obsolete("This class will be removed in a future version of AutoFixture. Instead, use an instance of RecursionGuard, composed with an instance of ThrowingRecursionHandler.", true)]
public class ThrowingRecursionGuard : RecursionGuard, ISpecimenBuilderNode, ISpecimenBuilder, IEnumerable<ISpecimenBuilder>, IEnumerable
Constructors
| Improve this Doc View SourceThrowingRecursionGuard(ISpecimenBuilder)
Initializes a new instance of the ThrowingRecursionGuard class.
Declaration
public ThrowingRecursionGuard(ISpecimenBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | builder | The builder. |
ThrowingRecursionGuard(ISpecimenBuilder, IEqualityComparer)
Initializes a new instance of the ThrowingRecursionGuard class.
Declaration
public ThrowingRecursionGuard(ISpecimenBuilder builder, IEqualityComparer comparer)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | builder | The intercepting builder to decorate. |
System.Collections.IEqualityComparer | comparer | An IEqualitycomparer implementation to use when comparing requests to determine recursion. |
Methods
| Improve this Doc View SourceCompose(IEnumerable<ISpecimenBuilder>)
Composes the supplied builders.
Declaration
public override 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
|
Overrides
| Improve this Doc View SourceHandleRecursiveRequest(Object)
Handles a request that would cause recursion by throwing an exception.
Declaration
[Obsolete("This class will be removed in a future version of AutoFixture. Instead, use an instance of RecursionGuard, composed with an instance of ThrowingRecursionHandler.", true)]
public override object HandleRecursiveRequest(object request)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The recursion causing request. |
Returns
Type | Description |
---|---|
System.Object | Nothing. Always throws. |
Overrides
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable