public void all_supported_script_folders_are_scanned() { _migrator.Migrate(Some.ConnectionInfo(), Some.MigrationInfo()); foreach (var mockScriptScanner in _mockScriptScannerFactory.GetMocks()) { mockScriptScanner.Verify(m => m.Scan(It.IsAny <string>(), It.IsAny <string>()), Times.Once); } }
public void when_an_up_script_is_missing_a_corresponding_down_script_then_a_warning_is_displayed() { const string upScriptPath = "20150406_scriptpath"; _mockScriptScannerFactory.GetMock(ScriptFolders.Up).Setup(m => m.Scan(It.IsAny <string>(), It.IsAny <string>())).Returns(new[] { new Script(upScriptPath, 1) }); _migrator.Migrate(Some.ConnectionInfo(), Some.MigrationInfo()); _mockOutput.Verify(m => m.WriteLine("The following 'up' scripts do not have a corresponding 'down' script, any rollback may not work as expected:".Yellow())); _mockOutput.Verify(m => m.WriteLine(" {0}".FormatWith(upScriptPath).Yellow()), Times.Once()); }