Ejemplo n.º 1
0
        public void Shuld_build_up_script_in_order()
        {
            _database.Stub(x => x.MigrationsTableExists()).Return(true);
            _database.Stub(x => x.BuildInsertScript(Arg <Migration> .Is.Anything)).Return("InsScript");
            var actual = _target.BuildUp(new[] {
                new Migration(2, "2-up", "2-down"),
                new Migration(3, "3-up", "3-down"),
                new Migration(1, "1-up", "1-down")
            }, 2);

            actual.Should().Be.EqualTo(@"-- Migration #1
1-up
InsScript;
-- Migration #2
2-up
InsScript;
");
        }