Esempio n. 1
0
        public void CanGenerateScriptWithIncludes()
        {
            // Arrange
            var collector = new ScriptParser($"{TEST_PROJECT_PATH}/Pre-Deployment/Script.PreDeployment.SimpleInclude.sql", _variableResolver);

            // Act
            var result = collector.GenerateScript();

            // Assert
            result.ShouldNotBeNull();
            result.ShouldMatch(@"PRINT N'Pre deploy'[\r\n]*PRINT N'Script1.sql'[\r\n]*GO[\r\n]*");
        }
Esempio n. 2
0
        public void CanGenerateScriptWithNestedIncludesContainingRelativePaths()
        {
            // Arrange
            var collector = new ScriptParser($"{TEST_PROJECT_PATH}/Pre-Deployment/Script.PreDeployment.NestedRelativePaths.sql", _variableResolver);

            // Act
            var result = collector.GenerateScript();

            // Assert
            result.ShouldNotBeNull();
            result.ShouldMatch(@"PRINT N'Pre deploy'[\r\n]*PRINT N'Script1.sql'[\r\n]*PRINT N'Script4.sql'[\r\n]*PRINT N'Script5.sql'[\r\n]*PRINT N'Script6.sql'[\r\n]*GO[\r\n]*");
        }
Esempio n. 3
0
        public void CanGenerateScriptWithoutIncludes()
        {
            // Arrange
            var collector = new ScriptParser($"{TEST_PROJECT_PATH}/Post-Deployment/Script.PostDeployment.Simple.sql", _variableResolver);

            // Act
            var result = collector.GenerateScript();

            // Assert
            result.ShouldNotBeNull();
            result.ShouldMatch(@"SELECT TOP 10 \* FROM MyTable[\r\n]*GO[\r\n]*");
        }