Ejemplo n.º 1
0
        public static CremaDataType CreateRandomEmptyType(string prefix, string postfix)
        {
            var dataType = new CremaDataType(IdentifierUtility.Next(prefix, postfix));

            dataType.IsFlag  = RandomUtility.Within(25);
            dataType.Comment = RandomUtility.Within(25) ? string.Empty : RandomUtility.NextString();
            return(dataType);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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));
            return(childTable);
        }
Ejemplo n.º 4
0
        public static CremaDataType CreateRandomType(string prefix, string postfix)
        {
            var dataType = new CremaDataType(IdentifierUtility.Next(prefix, postfix));

            dataType.IsFlag  = RandomUtility.Within(25);
            dataType.Comment = RandomUtility.Within(25) ? string.Empty : RandomUtility.NextString();
            dataType.AddRandomMembers(RandomUtility.Next(CremaDataTypeExtensions.MinMemberCount, CremaDataTypeExtensions.MaxMemberCount));
            return(dataType);
        }
Ejemplo n.º 5
0
        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);
            }

            dataSet.Tables.Add(dataTable);
            return(dataTable);
        }
Ejemplo n.º 6
0
        public static CremaDataTable CreateDerivedTable(this CremaDataTable dataTable, string prefix, string postfix)
        {
            var tableName = string.Empty;

            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);
        }