public void SyncronizeDatabasesTest_SyncWorkedAndSticks()
        {
            DatabaseSyncer target = new DatabaseSyncer();
            ConnectionData gold   = new ConnectionData()
            {
                DatabaseName       = "SqlBuildTest_SyncTest1",
                SQLServerName      = @"localhost\SQLEXPRESS",
                AuthenticationType = AuthenticationType.Windows
            };
            ConnectionData toUpdate = new ConnectionData()
            {
                DatabaseName       = "SqlBuildTest_SyncTest2",
                SQLServerName      = @"localhost\SQLEXPRESS",
                AuthenticationType = AuthenticationType.Windows
            };

            target.SyncronizationInfoEvent += new DatabaseSyncer.SyncronizationInfoEventHandler(target_SyncronizationInfoEvent);
            bool success = target.SyncronizeDatabases(gold, toUpdate, false);

            DatabaseDiffer differ  = new DatabaseDiffer();
            var            history = differ.GetDatabaseHistoryDifference(gold, toUpdate);

            CleanUpSyncTest2();

            Assert.AreEqual(0, history.BuildFileHistory.Count);
        }
示例#2
0
        public static bool SyncDatabases(CommandLineArgs cmdLine)
        {
            cmdLine = ValidateFlags(cmdLine);
            if (cmdLine == null)
            {
                return(false);
            }

            DatabaseSyncer dbSync = new DatabaseSyncer();

            dbSync.SyncronizationInfoEvent += new DatabaseSyncer.SyncronizationInfoEventHandler(dbSync_SyncronizationInfoEvent);

            return(dbSync.SyncronizeDatabases(cmdLine.SynchronizeArgs.GoldServer, cmdLine.SynchronizeArgs.GoldDatabase, cmdLine.Server,
                                              cmdLine.Database, cmdLine.ContinueOnFailure));
        }
        public void SyncronizeDatabasesTest_SyncWorked()
        {
            DatabaseSyncer target = new DatabaseSyncer();
            ConnectionData gold   = new ConnectionData()
            {
                DatabaseName       = "SqlBuildTest_SyncTest1",
                SQLServerName      = @"localhost\SQLEXPRESS",
                AuthenticationType = AuthenticationType.Windows
            };
            ConnectionData toUpdate = new ConnectionData()
            {
                DatabaseName       = "SqlBuildTest_SyncTest2",
                SQLServerName      = @"localhost\SQLEXPRESS",
                AuthenticationType = AuthenticationType.Windows
            };

            target.SyncronizationInfoEvent += new DatabaseSyncer.SyncronizationInfoEventHandler(target_SyncronizationInfoEvent);
            bool success = target.SyncronizeDatabases(gold, toUpdate, false);

            CleanUpSyncTest2();

            Assert.IsTrue(true);
        }