public void ModifyAsync_ArgumentNullException_Model() { // Arrange IScriptModifier modifier = new RemoveSqlCmdStatementsModifier(); // Act & Assert // ReSharper disable once AssignNullToNotNullAttribute Assert.Throws <ArgumentNullException>(() => modifier.ModifyAsync(null)); }
public async Task ModifyAsync_CorrectModification_Async(string input) { // Arrange IScriptModifier modifier = new RemoveSqlCmdStatementsModifier(); var project = new SqlProject("a", "b", "c"); project.ProjectProperties.DacVersion = new Version(1, 3, 0); var configuration = new ConfigurationModel { CustomFooter = "footer" }; var directories = new DirectoryPaths("projectDirectory", "latestArtifactsDirectory", "newArtifactsDirectory"); var sourcePaths = new DeploySourcePaths("newDacpacPath", "publishProfilePath", "previousDacpacPath"); var targetPaths = new DeployTargetPaths("deployScriptPath", "deployReportPath"); var paths = new PathCollection(directories, sourcePaths, targetPaths); var model = new ScriptModificationModel(input, project, configuration, paths, new Version(1, 2, 0), false); // Act await modifier.ModifyAsync(model); // Assert Assert.AreEqual(MultiLineInputWithoutSqlcmdStatements, model.CurrentScript); }