public void Should_Throw_If_Candle_Runner_Was_Not_Found() { // Given var fixture = new CandleFixture(); fixture.GivenDefaultToolDoNotExist(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <CakeException>(result); Assert.Equal("Candle: Could not locate executable.", result.Message); }
public void Should_Throw_If_Source_Files_Is_Empty() { // Given var fixture = new CandleFixture(); fixture.SourceFiles = new List <FilePath>(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <ArgumentException>(result); Assert.Equal("sourceFiles", ((ArgumentException)result).ParamName); }
public void Should_Add_Defines_To_Arguments_If_Provided() { // Given var fixture = new CandleFixture(); fixture.Settings.Defines = new Dictionary <string, string>(); fixture.Settings.Defines.Add("Foo", "Bar"); // When var result = fixture.Run(); // Then Assert.Equal("-dFoo=Bar \"/Working/Test.wxs\"", result.Args); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new CandleFixture(); fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <CakeException>(result); Assert.Equal("Candle: Process returned an error (exit code 1).", result.Message); }
public void Should_Throw_If_Process_Was_Not_Started() { // Given var fixture = new CandleFixture(); fixture.GivenProcessCannotStart(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <CakeException>(result); Assert.Equal("Candle: Process was not started.", result.Message); }
public void Should_Use_Candle_Runner_From_Tool_Path_If_Provided_On_Windows(string toolPath, string expected) { // Given var fixture = new CandleFixture(); fixture.Settings.ToolPath = toolPath; fixture.GivenSettingsToolPathExist(); // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Path.FullPath); }
public void Should_Use_Provided_Source_Files_In_Process_Arguments() { // Given var fixture = new CandleFixture(); fixture.SourceFiles.Clear(); fixture.SourceFiles.Add("./Test.wxs"); fixture.SourceFiles.Add("./Test2.wxs"); // When var result = fixture.Run(); // Then Assert.Equal("\"/Working/Test.wxs\" \"/Working/Test2.wxs\"", result.Args); }