Example #1
0
        private TestDatabase CreateTestDatabase()
        {
            TestDatabase db = CreateDatabase(new[] { CreateTable_A, CreateTable_B });

            using IIdGeneratorsForDatabaseInit idGenerators = IdGeneratorFactories.GetGeneratorsForDatabaseInit(db.Connection);
            foreach (IIdGenerator idGenerator in idGenerators)
            {
                idGenerator.InitDatabaseForIdGenerator();
            }
            return(db);
        }
Example #2
0
        private TestDatabase CreateTestDatabase()
        {
            string[] scripts =
            {
                string.Format(Script_TableWithAutoIncrementId, Table_AutoIncrementId),
                string.Format(Script_InsertTrigger,            Table_AutoIncrementId),
                string.Format(Script_UpdateTrigger,            Table_AutoIncrementId),
                string.Format(Script_TableWithManualId,        Table_ManualId),
                string.Format(Script_InsertTrigger,            Table_ManualId),
                string.Format(Script_UpdateTrigger,            Table_ManualId),
            };

            TestDatabase db = CreateDatabase(scripts);

            using IIdGeneratorsForDatabaseInit idGenerators = IdGeneratorFactories.GetGeneratorsForDatabaseInit(db.Connection);
            foreach (IIdGenerator idGenerator in idGenerators)
            {
                idGenerator.InitDatabaseForIdGenerator();
            }
            return(db);
        }