コード例 #1
0
ファイル: MigratorTests.cs プロジェクト: llenroc/squidex
        public async Task Should_migrate_step_by_step()
        {
            var migrator_0_1 = BuildMigration(0, 1);
            var migrator_1_2 = BuildMigration(1, 2);
            var migrator_2_3 = BuildMigration(2, 3);

            var migrator = new Migrator(status, new[] { migrator_0_1, migrator_1_2, migrator_2_3 }, log);

            await migrator.MigrateAsync();

            A.CallTo(() => migrator_0_1.UpdateAsync()).MustHaveHappened();
            A.CallTo(() => migrator_1_2.UpdateAsync()).MustHaveHappened();
            A.CallTo(() => migrator_2_3.UpdateAsync()).MustHaveHappened();

            A.CallTo(() => status.UnlockAsync(3)).MustHaveHappened();
        }
コード例 #2
0
ファイル: MigratorTests.cs プロジェクト: blakecodes/squidex
        public async Task Should_migrate_step_by_step()
        {
            var migrator_0_1 = BuildMigration(0, 1);
            var migrator_1_2 = BuildMigration(1, 2);
            var migrator_2_3 = BuildMigration(2, 3);

            var migrator = new Migrator(status, new[] { migrator_0_1, migrator_1_2, migrator_2_3 }, log);

            await migrator.MigrateAsync();

            A.CallTo(() => migrator_0_1.UpdateAsync(A <IEnumerable <IMigration> > .That.IsEmpty())).MustHaveHappened();
            A.CallTo(() => migrator_1_2.UpdateAsync(A <IEnumerable <IMigration> > .That.IsSameSequenceAs(migrator_0_1))).MustHaveHappened();
            A.CallTo(() => migrator_2_3.UpdateAsync(A <IEnumerable <IMigration> > .That.IsSameSequenceAs(migrator_0_1, migrator_1_2))).MustHaveHappened();

            A.CallTo(() => status.UnlockAsync(3)).MustHaveHappened();
        }