Esempio n. 1
0
            public override UpgradeEngine Given()
            {
                scriptProvider = Substitute.For <IScriptProvider>();
                scriptProvider.GetScripts(Arg.Any <IConnectionManager>()).Returns(new List <SqlScript>
                {
                    new SqlScript("#1", "Content of #1"),
                    new SqlScript("#3", "Content of #3"),
                });
                versionTracker = Substitute.For <IJournal>();
                versionTracker.GetExecutedScripts().Returns(new[] { "#1", "#2", "#3" });
                scriptExecutor = Substitute.For <IScriptExecutor>();

                var config = new UpgradeConfiguration
                {
                    ConnectionManager = new TestConnectionManager(Substitute.For <IDbConnection>())
                };

                config.ScriptProviders.Add(scriptProvider);
                config.ScriptExecutor = scriptExecutor;
                config.Journal        = versionTracker;

                var upgrader = new UpgradeEngine(config);

                return(upgrader);
            }
Esempio n. 2
0
            public override UpgradeEngine Given()
            {
                scriptProvider = Substitute.For <IScriptProvider>();
                versionTracker = Substitute.For <IJournal>();
                versionTracker.GetExecutedScripts().Returns(new List <ExecutedSqlScript>
                {
                    new ExecutedSqlScript {
                        Hash = "a", Name = "#1"
                    },
                    new ExecutedSqlScript {
                        Hash = "b", Name = "#2"
                    },
                    new ExecutedSqlScript {
                        Hash = "c", Name = "#3"
                    }
                });
                scriptExecutor = Substitute.For <IScriptExecutor>();

                var config = new UpgradeConfiguration
                {
                    ConnectionManager = new TestConnectionManager(Substitute.For <IDbConnection>())
                };

                config.ScriptProviders.Add(scriptProvider);
                config.ScriptExecutor = scriptExecutor;
                config.Journal        = versionTracker;

                var upgrader = new UpgradeEngine(config);

                return(upgrader);
            }
 public string[] GetExecutedScripts()
 {
     return(_innerJournal.GetExecutedScripts().ToArray());
 }
 public string[] GetExecutedScripts()
 {
     return(_journal.GetExecutedScripts());
 }