示例#1
0
        public static Database CreateDatabaseFull(string databaseName, int iterations)
        {
            Database database = new Database(databaseName);
            Table    table    = new Table("Table1");

            table.AddColumn(new Column("Column1", DataTypesFactory.GetDataTypesFactory().GetDataType(TypesKeyConstants.StringTypeKey)));
            table.AddColumn(new Column("Column2", DataTypesFactory.GetDataTypesFactory().GetDataType(TypesKeyConstants.StringTypeKey)));
            table.AddColumn(new Column("Column3", DataTypesFactory.GetDataTypesFactory().GetDataType(TypesKeyConstants.DoubleTypeKey)));
            table.AddColumn(new Column("Column4", DataTypesFactory.GetDataTypesFactory().GetDataType(TypesKeyConstants.IntTypeKey)));
            Row row;

            for (int i = 0; i < iterations; i++)
            {
                row = table.CreateRowDefinition();
                row.GetCell("Column1").data = VariousFunctions.GenerateRandomString(8);
                row.GetCell("Column2").data = VariousFunctions.GenerateRandomString(8);
                row.GetCell("Column3").data = i + ".6";
                row.GetCell("Column4").data = i + "";
                table.AddRow(row);
            }
            database.AddTable(table);
            return(database);
        }