C# Class Habanero.Testability.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.
Inheritance: ValidValueGenerator
Mostrar archivo 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

ValidValueGeneratorTextFile ( ISingleValueDef propDef, string fileName = null ) : System.Collections.Generic

Constructs a new instance of the generator

Private Methods

Method Description
CreateSampleValues ( ) : void
GetStringsFromFile ( ) : List

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

ValidValueGeneratorTextFile() public method

Constructs a new instance of the generator
public ValidValueGeneratorTextFile ( ISingleValueDef propDef, string fileName = null ) : System.Collections.Generic
propDef ISingleValueDef The definition of the property for which random values will be generated
fileName string The filename that contains the available values, including the path. If the path is relative, /// it will relate to the execution directory. If no filename is specified, the filename used will be the /// property name (e.g. FirstName) with a ".txt" extension.
return System.Collections.Generic