public SqliteSyncAllColumnsFixture()
        {
            var builder = new SqliteConnectionStringBuilder { DataSource = ClientSqliteFilePath };
            this.ClientSqliteConnectionString = builder.ConnectionString;

            GC.Collect();
            GC.WaitForPendingFinalizers();

            if (File.Exists(ClientSqliteFilePath))
                File.Delete(ClientSqliteFilePath);

            // create databases
            helperDb.CreateDatabase(serverDbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);

            var serverProvider = new SqlSyncProvider(ServerConnectionString);
            var clientProvider = new SqliteSyncProvider(ClientSqliteFilePath);
            var simpleConfiguration = new SyncConfiguration(new[] { "AllColumns" });

            Agent = new SyncAgent(clientProvider, serverProvider, simpleConfiguration);
        }
Esempio n. 2
0
        public SQLiteSyncSimpleFixture()
        {
            var builder = new SQLiteConnectionStringBuilder {
                DataSource = ClientSQLiteFilePath
            };

            this.ClientSQLiteConnectionString = builder.ConnectionString;

            if (File.Exists(ClientSQLiteFilePath))
            {
                File.Delete(ClientSQLiteFilePath);
            }

            // create databases
            helperDb.CreateDatabase(serverDbName);
            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);
            // insert table
            helperDb.ExecuteScript(serverDbName, datas);

            var serverProvider      = new SqlSyncProvider(ServerConnectionString);
            var clientProvider      = new SQLiteSyncProvider(ClientSQLiteFilePath);
            var simpleConfiguration = new SyncConfiguration(Tables);

            Agent = new SyncAgent(clientProvider, serverProvider, simpleConfiguration);
        }
Esempio n. 3
0
        public MySqlAllColumnsFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            helperDb.CreateMySqlDatabase(client1DbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);
        }
Esempio n. 4
0
        public SyncSimpleFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            helperDb.CreateDatabase(client1DbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }
        public SyncReinitializeTestsHttpFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            helperDb.CreateDatabase(client1DbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }
        public MySqlSyncIdentityColumnNotPkFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            helperDb.CreateMySqlDatabase(client1DbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }
Esempio n. 7
0
        public MySqlSyncOneTableOneFieldFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            helperDb.CreateMySqlDatabase(client1DbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }
Esempio n. 8
0
        public SyncPreffixAndSuffixWithSchemaFixture()
        {
            // create databases
            helperDb.CreateDatabase(serverDbName);
            helperDb.CreateDatabase(client1DbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createSchemaScript);
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }
        public SqliteSyncSimpleFixture()
        {
            var builder = new SqliteConnectionStringBuilder {
                DataSource = ClientSqliteFilePath
            };

            this.ClientSqliteConnectionString = builder.ConnectionString;

            if (File.Exists(ClientSqliteFilePath))
            {
                File.Delete(ClientSqliteFilePath);
            }

            // create databases
            helperDb.CreateDatabase(serverDbName);
            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);
            // insert table
            helperDb.ExecuteScript(serverDbName, datas);

            var serverProvider = new SqlSyncProvider(ServerConnectionString);

            SqliteConnection c = new SqliteConnection($"Data Source=fabrikamde.db");

            c.StateChange += (_, e) =>
            {
                if (e.CurrentState == ConnectionState.Open)
                {
                    var cmd = c.CreateCommand();
                    cmd.CommandText = "PRAGMA journal_mode=WAL;";
                    var i = cmd.ExecuteScalar();
                }
            };

            c.Open();

            c.Close();

            var clientProvider = new SqliteSyncProvider(ClientSqliteFilePath);


            var totoClientProvider = new SqliteSyncProvider(
                @"Data Source=D:\database\myData.db;Journal Mode=WAL;Page Size=8192");

            SqliteConnectionStringBuilder sqliteConnectionStringBuilder = new SqliteConnectionStringBuilder();


            var simpleConfiguration = new SyncConfiguration(Tables);

            Agent = new SyncAgent(clientProvider, serverProvider, simpleConfiguration);
        }
Esempio n. 10
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);

            Agent = new SyncAgent(clientProvider, serverProvider, Tables);
        }
Esempio n. 11
0
        public SQLiteTwoTablesFixture()
        {
            //var builder = new SQLiteConnectionStringBuilder { DataSource = ClientSQLiteFilePath };
            GC.Collect();
            GC.WaitForPendingFinalizers();

            if (File.Exists(ClientSQLiteFilePath))
            {
                File.Delete(ClientSQLiteFilePath);
            }

            // create databases
            helperDb.CreateDatabase(serverDbName);

            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);

            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }
Esempio n. 12
0
        public SqliteSyncHttpFixture()
        {
            var builder = new SqliteConnectionStringBuilder {
                DataSource = ClientSqliteFilePath
            };

            this.ClientSqliteConnectionString = builder.ConnectionString;

            if (File.Exists(ClientSqliteFilePath))
            {
                File.Delete(ClientSqliteFilePath);
            }

            // create databases
            helperDb.CreateDatabase(serverDbName);
            // create table
            helperDb.ExecuteScript(serverDbName, createTableScript);
            // insert table
            helperDb.ExecuteScript(serverDbName, datas);
        }