示例#1
0
 public virtual void AfterEach()
 {
     ScriptProvider = null;
     VersionTracker = null;
     ScriptExecutor = null;
     Log = null;
     DbUpgrader = null;
 }
示例#2
0
        public virtual void BeforeEach()
        {
            ScriptProvider = Substitute.For<IScriptProvider> ();
            VersionTracker = Substitute.For<IJournal> ();
            ScriptExecutor = Substitute.For<IScriptExecutor> ();
            ScriptPreprocessor = Substitute.For<IScriptPreprocessor>();

            Log = Substitute.For<IUpgradeLog> ();

            var config = new UpgradeConfiguration();

            config.ScriptPreprocessors.Add(ScriptPreprocessor);
            config.ScriptProviders.Add(ScriptProvider);
            config.ScriptExecutor = ScriptExecutor;
            config.Journal = VersionTracker;
            config.Log = Log;

            DbUpgrader = new UpgradeEngine(config);
        }
 private void WhenDatabaseIsUpgraded()
 {
     upgradeEngine = upgradeEngineBuilder.Build();
     upgradeResult = upgradeEngine.PerformUpgrade();
 }
 private void WhenCheckIfDatabaseUpgradeIsRequired()
 {
     upgradeEngine = upgradeEngineBuilder.Build();
     isUpgradeRequired = upgradeEngine.IsUpgradeRequired();
 }
 public ScriptingUpgrader(UpgradeEngine engine)
     : this(engine, new Options())
 {
 }
 public ScriptingUpgrader(UpgradeEngine engine, Options options)
 {
     m_engine = engine;
     m_options = options;
 }
示例#7
0
 public Upgrader(Context context, IUpgradeLog upgradeLog)
 {
     _context = context;
     _upgradeEngine = CreateUpgradeEngine(_context, upgradeLog);
 }
 private void WhenDatabaseIsUpgradedToVersion(ScriptVersion scriptVersion)
 {
     upgradeEngine = upgradeEngineBuilder.SetTargetVersion(scriptVersion).Build();
     upgradeResult = upgradeEngine.PerformUpgrade();
 }
示例#9
0
        private void GivenAnUpToDateDatabase()
        {
            var journal = GetJournal();
            journal.StoreExecutedScript(scripts[0]);
            journal.StoreExecutedScript(scripts[1]);
            journal.StoreExecutedScript(scripts[2]);

            upgradeEngine = upgradeEngineBuilder.Build();
        }
示例#10
0
 private void GivenAnOutOfDateDatabase()
 {
     upgradeEngine = upgradeEngineBuilder.Build();
 }