C# Class WebApplications.Testing.Data.RandomSet

Create a random record set.
Inheritance: ObjectSet
Show file Open project: webappsuk/CoreLibraries

Public Methods

Method Description
RandomSet ( [ recordSetDefinition, int minRows, int maxRows = 1000, double nullProbability = 0.1, object>.[ columnGenerators = null ) : System

Initializes a new instance of the RandomSet class.

RandomSet ( int columns, int minRows, int maxRows = 1000, double nullProbability = 0.1, object>.[ columnGenerators = null ) : System

Initializes a new instance of the RandomSet class.

Private Methods

Method Description
GenerateRecords ( [ recordSetDefinition, int minRows, int maxRows, double nullProbability, object>.[ columnGenerators = null ) : IEnumerable

Method Details

RandomSet() public method

Initializes a new instance of the RandomSet class.
public RandomSet ( [ recordSetDefinition, int minRows, int maxRows = 1000, double nullProbability = 0.1, object>.[ columnGenerators = null ) : System
recordSetDefinition [ The record set definition.
minRows int The min rows.
maxRows int The max rows.
nullProbability double The probability of a column's value being set to SQL null (0.0 for no nulls) [Defaults to 0.1 = 10%].
columnGenerators object>.[ The column generators is an array of functions that generate a value for each column, if the function is /// for a particular index then a random value is generated, if it is not null then the function is used. The function takes /// the current row number as it's only parameter and must return an object of the correct type for the column.
return System

RandomSet() public method

Initializes a new instance of the RandomSet class.
public RandomSet ( int columns, int minRows, int maxRows = 1000, double nullProbability = 0.1, object>.[ columnGenerators = null ) : System
columns int The number of columns, if less than one, then a random number is chosen.
minRows int The minimum number of rows [defaults to 0].
maxRows int The maximum number of rows [defaults to 1000].
nullProbability double The probability of a column's value being set to SQL null (0.0 for no nulls) [Defaults to 0.1 = 10%].
columnGenerators object>.[ The column generators is an array of functions that generate a value for each column, if the function is /// for a particular index then a random value is generated, if it is not null then the function is used. The function takes /// the current row number as it's only parameter and must return an object of the correct type for the column.
return System