public void CanInitMigratorConsoleWithValidArguments() { var console = new MigratorConsole( "/db", database, "/connection", connection, "/target", target, "/namespace", "FluentMigrator.Tests.Integration.Migrations", "/task", "migrate:up", "/version", "1"); console.Connection.ShouldBe(connection); console.Namespace.ShouldBe("FluentMigrator.Tests.Integration.Migrations"); console.Task.ShouldBe("migrate:up"); console.Version.ShouldBe(1); }
public void CanInitMigratorConsoleWithValidArguments() { string[] args = { "/db", database, "/connection", connection, "/log", "/target", target, "/namespace", "FluentMigrator.Tests.Integration.Migrations", "/task", "migrate:up", "/version", "1"}; MigratorConsole console = new MigratorConsole(args); console.Processor.ShouldBeOfType<SqliteProcessor>(); console.Connection.ShouldBe(connection); console.Namespace.ShouldBe("FluentMigrator.Tests.Integration.Migrations"); console.Log.ShouldBeTrue(); console.Task.ShouldBe("migrate:up"); console.Version.ShouldBe(1); }
public void TagsPassedToRunnerContextOnExecuteMigrations() { var migratorConsole = new MigratorConsole( "/db", database, "/connection", connection, "/verbose", "1", "/target", target, "/namespace", "FluentMigrator.Tests.Integration.Migrations", "/task", "migrate:up", "/version", "1", "/tag", "uk", "/tag", "production"); var expectedTags = new string[] { "uk", "production" }; CollectionAssert.AreEquivalent(expectedTags, migratorConsole.RunnerContext.Tags); }
public void ProviderSwitchesPassedToRunnerContextOnExecuteMigrations() { var migratorConsole = new MigratorConsole( "/db", database, "/connection", connection, "/target", target, "/output", "/namespace", "FluentMigrator.Tests.Unit.Runners.Migrations", "/task", "migrate:up", "/version", "0", "/providerswitches", "QuotedIdentifiers=true"); const string ExpectedProviderSwitces = "QuotedIdentifiers=true"; CollectionAssert.AreEquivalent(ExpectedProviderSwitces, migratorConsole.RunnerContext.ProviderSwitches); }
public void TransactionPerSessionShouldBeSetOnRunnerContextWithLongSwitch() { var console = new MigratorConsole( "/db", database, "/connection", connection, "/target", target, "/task", "migrate:up", "/transaction-per-session"); console.TransactionPerSession.ShouldBeTrue(); console.RunnerContext.TransactionPerSession.ShouldBeTrue(); }
public void TransactionPerSessionShouldBeSetOnRunnerContextWithShortSwitch() { var console = new MigratorConsole( "/db", Database, "/connection", Connection, "/target", Target, "/task", "migrate:up", "/tps"); console.TransactionPerSession.ShouldBeTrue(); console.RunnerContext.TransactionPerSession.ShouldBeTrue(); }