public void Should_Add_ExecutionTimeout_To_Arguments_If_Set(int executionTimeout, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.ExecutionTimeout = executionTimeout; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Add_LimitOutput_Flag_To_Arguments_If_Set(bool limitOutput, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.LimitOutput = limitOutput; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Add_Noop_Flag_To_Arguments_If_Set(bool noop, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Noop = noop; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Add_AcceptLicense_Flag_To_Arguments_If_Set(bool acceptLicense, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.AcceptLicense = acceptLicense; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Throw_If_Package_Id_Is_Null() { // Given var fixture = new ChocolateyDownloadFixture(); fixture.PackageId = null; // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsArgumentNullException(result, "packageId"); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new ChocolateyDownloadFixture(); fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsCakeException(result, "Chocolatey: Process returned an error (exit code 1)."); }
public void Should_Use_Chocolatey_Executable_From_Tool_Path_If_Provided_On_Windows(string toolPath, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.ToolPath = toolPath; fixture.GivenSettingsToolPathExist(); // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Path.FullPath); }
public void Should_Not_Add_AppendUseOriginalLocation_Flag_To_Arguments_If_Internalize_Is_Not_Set(bool appendUseOriginalLocation) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Internalize = false; fixture.Settings.AppendUseOriginalLocation = appendUseOriginalLocation; // When var result = fixture.Run(); // Then Assert.Equal("download \"MyPackage\" -y", result.Args); }
public void Should_Add_AppendUseOriginalLocation_Flag_To_Arguments_If_Set(bool appendUseOriginalLocation, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Internalize = true; fixture.Settings.AppendUseOriginalLocation = appendUseOriginalLocation; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Not_Add_ResourceLocation_To_Arguments_If_Internalize_Is_Not_Set(string resourcesLocation) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Internalize = false; fixture.Settings.ResourcesLocation = resourcesLocation; // When var result = fixture.Run(); // Then Assert.Equal("download \"MyPackage\" -y", result.Args); }
public void Should_Add_ResourceLocation_To_Arguments_If_Set(string resourcesLocation, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Internalize = true; fixture.Settings.ResourcesLocation = resourcesLocation; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Not_Add_InternalizeAllUrls_Flag_To_Arguments_If_Internalize_Is_Not_Set(bool internalizeAllUrls) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Internalize = false; fixture.Settings.InternalizeAllUrls = internalizeAllUrls; // When var result = fixture.Run(); // Then Assert.Equal("download \"MyPackage\" -y", result.Args); }
public void Should_Add_InternalizeAllUrls_Flag_To_Arguments_If_Set(bool internalizeAllUrls, string expected) { // Given var fixture = new ChocolateyDownloadFixture(); fixture.Settings.Internalize = true; fixture.Settings.InternalizeAllUrls = internalizeAllUrls; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }