public void Should_Find_GitReleaseManager_Executable_If_Tool_Path_Not_Provided() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); // When var result = fixture.Run(); // Then Assert.Equal("/Working/tools/GitReleaseManager.exe", result.Path.FullPath); }
public void Should_Add_Mandatory_Arguments() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); // When var result = fixture.Run(); // Then Assert.Equal("open --token \"token\" " + "-o \"repoOwner\" -r \"repo\" -m \"0.1.0\"", result.Args); }
public void Should_Throw_If_GitReleaseManager_Executable_Was_Not_Found() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.GivenDefaultToolDoNotExist(); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsCakeException(result, "GitReleaseManager: Could not locate executable."); }
public void Should_Throw_If_Settings_Are_Null() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.Settings = null; // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsArgumentNullException(result, "settings"); }
public void Should_Throw_If_Milestone_Is_Null() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.Milestone = string.Empty; // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsArgumentNullException(result, "milestone"); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsCakeException(result, "GitReleaseManager: Process returned an error (exit code 1)."); }
public void Should_Throw_If_Process_Was_Not_Started() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.GivenProcessCannotStart(); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsCakeException(result, "GitReleaseManager: Process was not started."); }
public void Should_Use_GitReleaseManager_Executable_From_Tool_Path_If_Provided_On_Windows(string toolPath, string expected) { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.Settings.ToolPath = toolPath; fixture.GivenSettingsToolPathExist(); // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Path.FullPath); }
public void Should_Add_NoLogo_To_Arguments_If_Set() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.Settings.NoLogo = true; // When var result = fixture.Run(); // Then Assert.Equal("open --token \"token\" " + "-o \"repoOwner\" -r \"repo\" -m \"0.1.0\" " + "--no-logo", result.Args); }
public void Should_Add_LogFilePath_To_Arguments_If_Set() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.Settings.LogFilePath = @"/temp/log.txt"; // When var result = fixture.Run(); // Then Assert.Equal("open --token \"token\" " + "-o \"repoOwner\" -r \"repo\" -m \"0.1.0\" " + "-l \"/temp/log.txt\"", result.Args); }
public void Should_Add_TargetDirectory_To_Arguments_If_Set() { // Given var fixture = new GitReleaseManagerMilestoneOpenerFixture(); fixture.Settings.TargetDirectory = @"/temp"; // When var result = fixture.Run(); // Then Assert.Equal("open --token \"token\" " + "-o \"repoOwner\" -r \"repo\" -m \"0.1.0\" " + "-d \"/temp\"", result.Args); }