public void WhenAssemblyIsProvidedAsNullDirectly_TheCallingAssemblyIsUsed() { var transition = new SqlScriptTransition(1, "", "", null, GetType().Namespace + ".SqlFileResources.BasicMultiStatement.sql"); var database = CreateDatabaseForBasicMultiStatementScriptTests(); transition.Up(database.Object); }
public void WhenThereIsNoFinalLinefeed_AfterTheFinalGo_TheStatementIsStillExtractedCorrectly() { var transition = new SqlScriptTransition(1, "", "", GetType().Assembly, GetType().Namespace + ".SqlFileResources.BasicMultiStatement.sql"); var database = CreateDatabaseForBasicMultiStatementScriptTests(); transition.Up(database.Object); }
public void WhenNoTimeoutIsProvidedOnTheScript_TheDefaultTimeoutIsUsed() { // arrange var transition = new SqlScriptTransition(1, "", "", GetType().Namespace + ".SqlFileResources.BasicMultiStatement.sql"); var database = CreateDatabaseForBasicMultiStatementScriptTests(); // act transition.Up(database.Object); // assert database.Verify(db => db.RunSql(It.IsAny <string>(), SqlClientDatabase.DbDefaultCommandTimeout), Times.Exactly(3)); }
public void WhenATimeoutIsProvidedOnTheScript_TheTimeoutIsPassedWhenRunningSql() { // arrange const int timeout = 180; var transition = new SqlScriptTransition(1, "", "", GetType().Namespace + ".SqlFileResources.BasicMultiStatement.sql") { Timeout = timeout }; var database = CreateDatabaseForBasicMultiStatementScriptTests(); // act transition.Up(database.Object); // assert database.Verify(db => db.RunSql(It.IsAny <string>(), timeout), Times.Exactly(3)); }