C# Class Habanero.Testability.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
A potential future improvement of this test is to allow you to build up a cache of values. For instance, you could store the first 100 values generated and then access that cache rather than regenerate. This could give you a significant performance boost. The main trouble is how to set that cache size - where do you pass the size through to the generator?
Inheritance: ValidValueGenerator
Show file Open project: Chillisoft/habanero.testability

Public Methods

Method Description
GenerateValidValue ( ) : object

Generates a valid value taking into account only the IPropRules. I.e. any InterPropRules will not be taken into account. The IValidValueGeneratorNumeric's methods are used by the BOTestFactory to create valid values taking into account InterPropRules

ValidValueGeneratorRegEx ( ISingleValueDef singleValueDef, string regExPhrase ) : System

Creates a new instance of the generator

Private Methods

Method Description
GenerateValueUsingRex ( ) : object

Method Details

GenerateValidValue() public method

Generates a valid value taking into account only the IPropRules. I.e. any InterPropRules will not be taken into account. The IValidValueGeneratorNumeric's methods are used by the BOTestFactory to create valid values taking into account InterPropRules
public GenerateValidValue ( ) : object
return object

ValidValueGeneratorRegEx() public method

Creates a new instance of the generator
public ValidValueGeneratorRegEx ( ISingleValueDef singleValueDef, string regExPhrase ) : System
singleValueDef ISingleValueDef The property definition that indicates which property the values are being generated for
regExPhrase string The regular expression against which generated values must match
return System