Abstract base class for housing shared logic between all builders and allowing a base, unconstructable class to use to reference a collection of builders.
More...
|
static bool | TryCreateSubstituteFor< T > (bool callThrough, out T result) |
| Attempt to create a substitute for the given type.
|
static bool | TryCreateSubstituteFor< T > (bool callThrough, object[] constructorParameters, out T result) |
| Attempt to create a substitute for the given type with parameters.
|
static bool | TryCreateSubstituteFor< T > (bool throwOnError, bool callThrough, out T result) |
| Attempt to create a substitute from a type with a parameterless constructor.
|
static bool | TryCreateSubstituteFor< T > (bool throwOnError, bool callThrough, object[] constructorParameters, out T result) |
| Attempts perform Substitute.For<T>.
|
|
const string | ENV_FORCE_NSUBSTITUTE_FOR_RANDOMVALUEGEN = "FORCE_NSUBSTITUTE_FOR_RANDOMVALUEGEN" |
| The environment variable which is observed to force using NSubstitute for random value generation of interface types.
|
|
static Assembly | FindOrLoadAssembly< T > (string name, bool retrying) |
| Attempts to load the assembly alongside the Type T.
|
|
static readonly Dictionary< Type, Type > | DynamicBuilders = new Dictionary<Type, Type>() |
| Holds a lookup of all GenericBuilder classes which have been generated to facilitate automatic property building. Searched when looking for a builder to generate a property before attempting to generate a builder type (re-use)
|
static readonly Dictionary< Type, Type > | UserBuilders = new Dictionary<Type, Type>() |
| Holds a lookup of GenericBuilder classes which were provided by consuming code. Searched before searching the DynamicBuilders lookup or attempting to create an auto-generated builder type.
|
static readonly Type | NullableGeneric = typeof(Nullable<>) |
| Provides a lookup to the type which is the generic Nulllable.
|
static readonly Type | GenericBuilderBaseType = typeof(GenericBuilderBase) |
| Provides a lookup to the type which is the GenericBuilder.
|
|
static int | MaxRandomPropsLevel = 10 [get, set] |
| Sets the maximum level to go to when generating random properties of random properties, to prevent stack and memory overflows.
|
Abstract base class for housing shared logic between all builders and allowing a base, unconstructable class to use to reference a collection of builders.
◆ FindOrLoadAssembly< T >()
Assembly PeanutButter.RandomGenerators.GenericBuilderBase.FindOrLoadAssembly< T > |
( |
string | name, |
|
|
bool | retrying ) |
|
staticprotected |
Attempts to load the assembly alongside the Type T.
- Parameters
-
- Template Parameters
-
- Returns
◆ TryCreateSubstituteFor< T >() [1/4]
bool PeanutButter.RandomGenerators.GenericBuilderBase.TryCreateSubstituteFor< T > |
( |
bool | callThrough, |
|
|
object[] | constructorParameters, |
|
|
out T | result ) |
|
static |
Attempt to create a substitute for the given type with parameters.
- Parameters
-
callThrough | Create a partial sub where calls go through to the original implementation |
constructorParameters | |
result | |
- Template Parameters
-
- Returns
◆ TryCreateSubstituteFor< T >() [2/4]
bool PeanutButter.RandomGenerators.GenericBuilderBase.TryCreateSubstituteFor< T > |
( |
bool | callThrough, |
|
|
out T | result ) |
|
static |
Attempt to create a substitute for the given type.
- Parameters
-
callThrough | Create a partial sub where calls go through to the original implementation |
result | |
- Template Parameters
-
- Returns
◆ TryCreateSubstituteFor< T >() [3/4]
bool PeanutButter.RandomGenerators.GenericBuilderBase.TryCreateSubstituteFor< T > |
( |
bool | throwOnError, |
|
|
bool | callThrough, |
|
|
object[] | constructorParameters, |
|
|
out T | result ) |
|
static |
Attempts perform Substitute.For<T>.
- Template Parameters
-
- Returns
- Exceptions
-
◆ TryCreateSubstituteFor< T >() [4/4]
bool PeanutButter.RandomGenerators.GenericBuilderBase.TryCreateSubstituteFor< T > |
( |
bool | throwOnError, |
|
|
bool | callThrough, |
|
|
out T | result ) |
|
static |
Attempt to create a substitute from a type with a parameterless constructor.
- Parameters
-
throwOnError | |
callThrough | |
result | |
- Template Parameters
-
- Returns
The documentation for this class was generated from the following file:
- source/TestUtils/PeanutButter.RandomGenerators/GenericBuilderBase.cs