public static CremaDataTable CreateRandomTable(string prefix, string postfix) { var dataTable = new CremaDataTable(IdentifierUtility.Next(prefix, postfix)); dataTable.AddRandomColumns(RandomUtility.Next(MinColumnCount, MaxColumnCount)); dataTable.AddRandomRows(RandomUtility.Next(MinRowCount, MaxRowCount)); return(dataTable); }
public static CremaDataTable AddRandomChild(this CremaDataTable dataTable) { var childTable = dataTable.Childs.Add(IdentifierUtility.Next(ChildPrefix, ChildPostfix)); childTable.AddRandomColumns(RandomUtility.Next(CremaDataTableExtensions.MinColumnCount, CremaDataTableExtensions.MaxColumnCount)); childTable.AddRandomRows(RandomUtility.Next(MinRowCount, MaxRowCount)); childTable.AcceptChanges(); return(childTable); }
public static CremaDataType CreateRandomEmptyType(string prefix, string postfix) { var dataType = new CremaDataType(IdentifierUtility.Next(prefix, postfix)) { IsFlag = RandomUtility.Within(25), Comment = RandomUtility.Within(25) ? string.Empty : RandomUtility.NextString() }; return(dataType); }
public static CremaDataType CreateRandomType(string prefix, string postfix) { var dataType = new CremaDataType(IdentifierUtility.Next(prefix, postfix)) { IsFlag = RandomUtility.Within(25), Comment = RandomUtility.Within(25) ? string.Empty : RandomUtility.NextString() }; dataType.AddRandomMembers(RandomUtility.Next(CremaDataTypeExtensions.MinMemberCount, CremaDataTypeExtensions.MaxMemberCount)); return(dataType); }
public static CremaDataTable AddRandomTable(this CremaDataSet dataSet) { var dataTable = CremaDataTableExtensions.CreateRandomTable(TablePrefix, TablePostfix); while (dataSet.Tables.Contains(dataTable.TableName) == true) { dataTable.TableName = IdentifierUtility.Next(TablePrefix, TablePostfix); } dataTable.AcceptChanges(); dataSet.Tables.Add(dataTable); return(dataTable); }
public static CremaDataTable CreateDerivedTable(this CremaDataTable dataTable, string prefix, string postfix) { string tableName; do { tableName = IdentifierUtility.Next(prefix, postfix); }while (dataTable.DataSet.Tables.Contains(tableName) == true); var derivedTable = dataTable.Inherit(tableName); derivedTable.AddRandomRows(RandomUtility.Next(MinRowCount, MaxRowCount)); return(derivedTable); }