Example #1
0
        public void WhenAssemblyIsProvidedAsNullDirectly_TheCallingAssemblyIsUsed()
        {
            var transition = new SqlScriptTransition(1, "", "", null, GetType().Namespace + ".SqlFileResources.BasicMultiStatement.sql");

            var database = CreateDatabaseForBasicMultiStatementScriptTests();

            transition.Up(database.Object);
        }
Example #2
0
        public void WhenThereIsNoFinalLinefeed_AfterTheFinalGo_TheStatementIsStillExtractedCorrectly()
        {
            var transition = new SqlScriptTransition(1, "", "", GetType().Assembly, GetType().Namespace + ".SqlFileResources.BasicMultiStatement.sql");

            var database = CreateDatabaseForBasicMultiStatementScriptTests();

            transition.Up(database.Object);
        }
Example #3
0
        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));
        }
Example #4
0
        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));
        }