C# (CSharp) Habanero.Testability Namespace

Nested Namespaces

Habanero.Testability.Helpers
Habanero.Testability.Testers
Habanero.Testability.Tests

Classes

Name Description
BODefaultValueRegistry This is a registry of the BOTestValues for various Properties and Single Relationships of a BusinessObject. This was creates so as to allow the Developer to BOTestFactory{TBO}.SetValueFor{TReturn} and such that when the Object is created with the BOTestFactory.CreateBusinessObject etc or updated with BOTestFactory.UpdateCompulsoryProperties this will be the value used.
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
BOPropValueGeneratorRegistry.ValidValueGeneratorInfo
BOTestFactory The BOTestFactory is a factory used to construct a Business Object for testing. The Constructed Business object can be constructed a a valid (i.e. saveable Business object) CreateValidBusinessObject .
A Valid Property Value can also be generated for any particular Prop using one of the overloads of GetValidPropValue(IBOProp), GetValidPropValue(Habanero.Base.ISingleValueDef), GetValidPropValue(Habanero.Base.IBusinessObject,string) GetValidPropValue(System.Type,string).
A Valid Relationship can be generated for any particular relationship using GetValidRelationshipValue.
Although all of these are valid methods of using the BOTestFactory you are most likely to use the Generic BOTestFactory BOTestFactory{TBO} this test factory has even more powerfull mechanisms to use for generating valid Relationship and PropValues.
FactoryExtensionMethods
Messages
ValidValidGeneratorByteArray Generates a valid value for PropDef of type DateTime.
ValidValidGeneratorImage Generates a valid value for PropDef of type DateTime.
ValidValueGeneratorBool Generates a valid value for PropDef of type DateTime.
ValidValueGeneratorDate Generates a valid value for PropDef of type DateTime.
ValidValueGeneratorDecimal
ValidValueGeneratorDouble
ValidValueGeneratorEnum This will generate a valid value for the Enum identified by IPropDef.IPropDef.PropertyType
ValidValueGeneratorGuid
ValidValueGeneratorIncrementalInt
ValidValueGeneratorInt Generates a Valid Value for an Integer (int or Int32) based on the min or max value in the PropDef
ValidValueGeneratorLong
ValidValueGeneratorLookupList
ValidValueGeneratorName
ValidValueGeneratorRegEx Generates valid values that match a given regular expression. The generation is done using Rex.exe, a Microsoft Research Project executable that must be placed in the working directory of the application. The executable is run as a command-line application that runs slowly the first time and then faster once the operating system stores/caches the exe. You can find the homepage of Rex here: http://research.microsoft.com/en-us/projects/rex/ You can find additional commentary/limitations on Rex here: http://www.kodefuguru.com/post/2010/05/03/Generate-Matches-for-Regular-Expressions-Using-Rex.aspx
ValidValueGeneratorShort Generates a Valid Value for an Integer (int or Int32) based on the min or max value in the PropDef
ValidValueGeneratorString
ValidValueGeneratorTextFile Generates random values from a text file. If a filename is not specified, the generator will look for a filename that has the name of the property (e.g. FirstName) with a ".txt" extension. Each item should appear on a different line in the text file. Once the values have been read from the file once, the items are cached in memory for rapid test performance.