public void TestFailedMigrationBroadcast()
        {
            TestMigrationContext context = new TestMigrationContext();
            MigrationProcess process = new MigrationProcess();
            MigrationTask2 task = new MigrationTask2();

            task.ForceFail = true;
            process.MigrationStarted +=
                new MigrationProcess.MigrationStatusEventHandler(process_MigrationStarted);
            process.MigrationSuccessful +=
                new MigrationProcess.MigrationStatusEventHandler(process_MigrationSuccessful);
            process.MigrationFailed +=
                new MigrationProcess.MigrationStatusEventHandler(process_MigrationFailed);

            try
            {
                process.ApplyPatch(context, task, true);
            }
            catch (MigrationException me)
            {
                Assert.IsTrue(started, "'started' should be true");
                Assert.IsFalse(succeeded, "'succeeded' should be false");
                Assert.IsTrue(failed, "'failed' should be true");
                throw me;
            }
        }
        public void TestNoBroadcast()
        {
            TestMigrationContext context = new TestMigrationContext();
            MigrationProcess process = new MigrationProcess();
            MigrationTask1 task = new MigrationTask1();

            process.MigrationStarted +=
                new MigrationProcess.MigrationStatusEventHandler(process_MigrationStarted);
            process.MigrationSuccessful +=
                new MigrationProcess.MigrationStatusEventHandler(process_MigrationSuccessful);
            process.MigrationFailed +=
                new MigrationProcess.MigrationStatusEventHandler(process_MigrationFailed);
            process.ApplyPatch(context, task, false);

            Assert.IsFalse(started, "'started' should be false");
            Assert.IsFalse(succeeded, "'succeeded' should be false");
            Assert.IsFalse(failed, "'failed' should be false");
        }
        public void TestNoListeners()
        {
            TestMigrationContext context = new TestMigrationContext();
            MigrationProcess process = new MigrationProcess();
            MigrationTask1 task = new MigrationTask1();

            process.ApplyPatch(context, task, true);

            Assert.IsFalse(started, "'started' should be false");
            Assert.IsFalse(succeeded, "'succeeded' should be false");
            Assert.IsFalse(failed, "'failed' should be false");
        }