Пример #1
0
        public static void SetupHubLocal(DB_TestingHelper dbTestingHelper)
        {
//hub sql local
            TI.trace("Remove all tables from Hub local db");
            dbTestingHelper.RemoveAllHubLocalTables();
            TI.trace("Setup hub local db");
            dbTestingHelper.SetupHubLocalSql();
        }
Пример #2
0
        public static void SetupMongo(DB_TestingHelper dbTestingHelper)
        {
//setup mongo
            TI.trace("Drop and recreate mongo audit collections");
            dbTestingHelper.DropAndRecreateMongoAuditCollections();
            TI.trace("Drop and recreate mongo routing collections");
            dbTestingHelper.DropAndRecreateMongoRoutingCollections();
        }
Пример #3
0
        public static void SetupHubDistributr(DB_TestingHelper dbTestingHelper, IContainer structureMapContainer)
        {
//hub sql dist
            CokeDataContext ctxHubDist = structureMapContainer.GetInstance<CokeDataContext>();
            TI.trace("Remove all tables from Hub distributr db");
            dbTestingHelper.RemoveAllHubDistTables();
            TI.trace("Setup Hub distributr db");
            dbTestingHelper.SetupHubDistSql(ctxHubDist);
        }
Пример #4
0
        public static void SetupServerDb(DB_TestingHelper dbTestingHelper, Autofac.IContainer autofacContainer)
        {
//server sql dist
            TI.trace("Remove all tables from Server distributr");
            dbTestingHelper.RemoveAllServerTables();
            IInsertTestData td = autofacContainer.Resolve<IInsertTestData>();
            CokeDataContext ctxServer = autofacContainer.Resolve<CokeDataContext>();
            TI.trace("Run scripts and add data to server");
            dbTestingHelper.SetupServerSql(true, ctxServer, td);
        }
Пример #5
0
 public static DB_TestingHelper GetDefaultDbTestingHelper()
 {
     string serverSqlConnectionString = ConfigurationManager.AppSettings["Server_DistributrConnectionString"];
     string hubSqlConnectionString = ConfigurationManager.AppSettings["Hub_DistributrConnectionString"];
     string hubLocalConnectionString = ConfigurationManager.AppSettings["Hub_RoutingConnectionString"];
     string mongoConnectionstring = ConfigurationManager.AppSettings["MongoRoutingConnectionString"];
     string mongoAuditingConnectionString = ConfigurationManager.AppSettings["MongoAuditingConnectionString"];
     string createtablesscriptlocation = ConfigurationManager.AppSettings["createtablesscriptlocation"];
     var cs = new DB_TestingHelper(hubSqlConnectionString, hubLocalConnectionString, serverSqlConnectionString, mongoConnectionstring, mongoAuditingConnectionString, createtablesscriptlocation);
     return cs;
 }
Пример #6
0
        public static void SetupAllDatabases(DB_TestingHelper dbTestingHelper, Autofac.IContainer autofacContainer,
            StructureMap.IContainer structureMapContainer)
        {
            TI.trace("Begin database setup");

            SetupServerDb(dbTestingHelper, autofacContainer);

            SetupHubDistributr(dbTestingHelper, structureMapContainer);

            SetupHubLocal(dbTestingHelper);

           
            SetupMongo(dbTestingHelper);
        }