public void can_run_setup_method_when_setup_does_not_exist()
        {
            var migration = new Migration(typeof(MigrationTestType2));
            Assert.IsNotNull(migration);
            mocks.ReplayAll();

            migration.Setup(setupRunner, new TestLogger(), opRepos);

            mocks.VerifyAll();
        }
        public void can_run_down_method()
        {
            var migration = new Migration(typeof(MigrationTestType));
            Assert.IsNotNull(migration);

            Expect.Call(() => driver.BeforeDown(4));
            Expect.Call(() => driver.Run(Arg<Action<IGenericOperation>>.Is.Anything));
            Expect.Call(driver.DriverName).Return("TestDriver");
            Expect.Call(() => driver.AfterDown(4));

            Expect.Call(() => schemaInfo.DeleteSchemaVersion(4, typeof(MigrationTestType).Assembly.GetName().Name));
            mocks.ReplayAll();

            migration.Down(driver, new TestLogger(), schemaInfo);

            mocks.VerifyAll();
        }
        public void can_run_setup_method_when_setup_exists()
        {
            var migration = new Migration(typeof(MigrationTestType));
            Assert.IsNotNull(migration);

            Expect.Call(() => opRepos.Register<IGenericOperation>(typeof(String)));
            mocks.ReplayAll();

            migration.Setup(setupRunner, new TestLogger(), opRepos);

            mocks.VerifyAll();
        }
 public void can_create_instance_with_type()
 {
     var migration = new Migration(typeof(MigrationTestType));
     Assert.IsNotNull(migration);
     Assert.AreEqual(4, migration.Version);
 }