C# Класс Habanero.Testability.BOPropValueGeneratorRegistry

This is a registry of the ValidValueGenerators Registered for a specific PropertyDefinition ISingleValueDef of a particular Property for a specified Business Object type. This was creates so as to allow the Developer to override the Generic ValidValueGenerator.
E.g. if the Business object Property has specific rules or things that must be set to ensure that it is a valid saveable business object. Then you can register a specialised Valid Value Generator that will generate the appropriate value for that Business Object Property.
This is also used behind the scenes when you want to generate a business object with a specified non compulsory property in a particular case. Then a Valid Value Generator is registered for that ISingleValueDef and the non compulsory prop will have a value set. For more details see BOTestFactory
Показать файл Открыть проект

Открытые методы

Метод Описание
ClearAll ( ) : void

Clears all ValidValue Generators registered.

IsRegistered ( ISingleValueDef propDef ) : bool

Returns True if a value Gen is registered with the singleValueDef propDef

Register ( ISingleValueDef propDef, Type validValuGenType, object parameter = null ) : void

Register a Valid Value Generator to be used for generating values for a specified PropDef.

Resolve ( ISingleValueDef propDef ) : ValidValueGenerator

Resolves the registered ValidValueGenerator for the PropDef if one is registered. Else tries to find a ValidValueGenerator for the specified PropDefs Property Type using the ValidValueGeneratorRegistry

Приватные методы

Метод Описание
ClearPreviousInstances ( ISingleValueDef propDef ) : void
GeneratorHasConstructorWithExtraParameter ( Type validValueGenType ) : bool
GetClassType ( ISingleValueDef propDef ) : string
GetKeyName ( ISingleValueDef propDef ) : string
ValidateGeneratorType ( Type factoryType, string typeName ) : void

Описание методов

ClearAll() публичный Метод

Clears all ValidValue Generators registered.
public ClearAll ( ) : void
Результат void

IsRegistered() публичный Метод

Returns True if a value Gen is registered with the singleValueDef propDef
public IsRegistered ( ISingleValueDef propDef ) : bool
propDef ISingleValueDef
Результат bool

Register() публичный Метод

Register a Valid Value Generator to be used for generating values for a specified PropDef.
public Register ( ISingleValueDef propDef, Type validValuGenType, object parameter = null ) : void
propDef ISingleValueDef The property definition for which this generator type is being assigned
validValuGenType Type The type of generator which will be instantiated when a valid value is needed
parameter object An additional parameter to pass to the constructor of the generator
Результат void

Resolve() публичный Метод

Resolves the registered ValidValueGenerator for the PropDef if one is registered. Else tries to find a ValidValueGenerator for the specified PropDefs Property Type using the ValidValueGeneratorRegistry
public Resolve ( ISingleValueDef propDef ) : ValidValueGenerator
propDef ISingleValueDef
Результат ValidValueGenerator