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]*"); }
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]*"); }
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]*"); }