コード例 #1
0
        public void Shuld_build_down_script_in_order()
        {
            _database.Stub(x => x.MigrationsTableExists()).Return(true);
            _database.Stub(x => x.BuildDeleteScript(Arg <Migration> .Is.Anything)).Return("DelScript");
            var actual = _target.BuildDown(new[] {
                new Migration(2, "2-up", "2-down"),
                new Migration(1, "1-up", "1-down"),
                new Migration(3, "3-up", "3-down")
            }, 2);

            actual.Should().Be.EqualTo(@"-- Migration #3
3-down
DelScript;
-- Migration #2
2-down
DelScript;
");
        }