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
파일 보기 프로젝트 열기: Chillisoft/habanero.testability

공개 메소드들

메소드 설명
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