public void DropDatabase()
 {
     DeltaRunnerConsole console = new DeltaRunnerConsole();
     console.Start(new string[] { "-c", "DROP", "-s", "(local)", "-d", "Fred", "-u", "test", "-p", "test" });
     Assert.IsTrue(console.Results.IndexOf(@"deltaRunner provided by EntropyZero Consulting") > -1);
     Assert.IsTrue(console.Results.IndexOf(@"Usage:") == -1);
 }
 public void CheckUsage()
 {
     DeltaRunnerConsole console = new DeltaRunnerConsole();
     console.Start(new string[]{""});
     Assert.IsTrue(console.Results.IndexOf(@"deltaRunner provided by EntropyZero Consulting") > -1);
     Assert.IsTrue(console.Results.IndexOf(@"Usage:") > -1);
 }
 public void DontProvideDeltaPath()
 {
     DeltaRunnerConsole console = new DeltaRunnerConsole();
     console.Start(new string[] {"-c", "APPLY", "-s", "(local)", "-d", "deltarunner", "-u", "test", "-p", "test"});
     Assert.IsTrue(console.Results.IndexOf(@"deltaRunner provided by EntropyZero Consulting") > -1);
     Assert.IsTrue(console.Results.IndexOf(@"Usage:") > -1);
 }
        public void UpdateDatabase_IncludeStaticSqlFiles()
        {
            if (TableExists("Table2_Static"))
                ExecuteNonQuery("Drop Table Table2_Static");
            Assert.AreEqual(false, TableExists("Table2_Static"));

            DeltaRunnerBase deltaRunner = DeltaRunnerFactory.CreateDeltaRunner(ConnectionString, deltaPath, true);
            deltaRunner.RemoveDeltaRunner();
            deltaRunner.PrepareForDeltaRunner();
            Assert.AreEqual("0", deltaRunner.GetLatestVersion());

            string postDeltas = Path.Combine(deltaPath, "..\\SampleStaticFile1.sql");
            postDeltas += ",";
            postDeltas += Path.Combine(deltaPath, "..\\SampleStaticFile2.sql");
            postDeltas += ",";
            postDeltas += Path.Combine(deltaPath, "..\\SampleStaticFile3.sql");

            DeltaRunnerConsole console = new DeltaRunnerConsole();
            console.Start(new string[] { "-c", "APPLYWITHFILES", "-s", "(local)", "-d", "DeltaRunner", "-u", "test", "-p", "test", "-delta", deltaPath, "-post", postDeltas});

            Assert.AreEqual("00003", deltaRunner.GetLatestVersion());
            Assert.AreEqual(true, TableExists("Table2_Static"));
        }