Esempio n. 1
0
        public MySqlSyncSimpleFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);
            // insert table
            helperDb.ExecuteScript(serverDbName, datas);

            helperDb.CreateMySqlDatabase(clientDbName);

            var serverProvider      = new SqlSyncProvider(ServerConnectionString);
            var clientProvider      = new MySqlSyncProvider(ClientMySqlConnectionString);
            var simpleConfiguration = new SyncConfiguration(Tables);

            Agent = new SyncAgent(clientProvider, serverProvider, simpleConfiguration);
        }
Esempio n. 2
0
        public WordPressFixture()
        {
            // create client database
            helperDb.DropMySqlDatabase(clientDbName);
            helperDb.CreateMySqlDatabase(clientDbName);

            helperDb.DropMySqlDatabase(serverDbName);
            // restore server database
            var wordpressscript = Path.Combine(Directory.GetCurrentDirectory(), "Backup", "Wordpress.sql");
            var fs     = File.OpenText(wordpressscript);
            var script = fs.ReadToEnd();

            helperDb.ExecuteMySqlScript("sys", script);

            var serverProvider      = new MySqlSyncProvider(ServerConnectionString);
            var clientProvider      = new MySqlSyncProvider(ClientMySqlConnectionString);
            var simpleConfiguration = new SyncConfiguration(Tables);

            Agent = new SyncAgent(clientProvider, serverProvider, simpleConfiguration);
        }