Beispiel #1
0
            public void Should_Add_Transform_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.Transform = "cake.xslt";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -t \"cake.xslt\" -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #2
0
            public void Should_Add_Component_Group_Name_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.ComponentGroupName = "CakeComponentGroup";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -cg CakeComponentGroup -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #3
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new HeatFixture();
                fixture.GivenProcessCannotStart();

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsType<CakeException>(result);
                Assert.Equal("Heat: Process was not started.", result?.Message);
            }
Beispiel #4
0
            public void Should_Add_NoLogo_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.NoLogo = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -nologo -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #5
0
            public void Should_Add_Treat_Specific_Warnings_As_Errors_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.TreatSpecificWarningsAsErrors = new[] { "1101", "1102" };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -wx1101 -wx1102 -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #6
0
            public void Should_Throw_If_Environment_Is_Null()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Environment = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "environment");
            }
Beispiel #7
0
            public void Should_Add_Website_Harvest_Type_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.HarvestType = WiXHarvestType.Website;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("website \"Default Web Site\" -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #8
0
            public void Should_Add_Directory_Reference_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.DirectoryReferenceId = "CakeAppDirectoryReference";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -dr CakeAppDirectoryReference -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #9
0
            public void Should_Not_Add_Generate_To_Arguments_If_Default_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.Generate = WiXGenerateType.Components;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #10
0
            public void Should_Throw_If_Output_File_Empty()
            {
                // Given
                var fixture = new HeatFixture();
                fixture.OutputFile = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsType<ArgumentNullException>(result);
                Assert.Equal("outputFile", ((ArgumentException)result)?.ParamName);
            }
Beispiel #11
0
            public void Should_Throw_If_Heat_Runner_Was_Not_Found()
            {
                // Given
                var fixture = new HeatFixture();
                fixture.GivenDefaultToolDoNotExist();

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsType<CakeException>(result);
                Assert.Equal("Heat: Could not locate executable.", result?.Message);
            }
Beispiel #12
0
            public void Should_Throw_If_Directory_Path_Empty()
            {
                // Given
                var fixture = new HeatFixture();
                fixture.DirectoryPath = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsType<ArgumentNullException>(result);
                Assert.Equal("directoryPath", ((ArgumentException)result)?.ParamName);
            }
Beispiel #13
0
            public void Should_Add_Performance_Harvest_Type_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();
                fixture.HarvestType = WiXHarvestType.Perf;
                fixture.HarvestTarget = "Cake Category";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("perf \"Cake Category\" -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #14
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new HeatFixture();
                fixture.GivenProcessExitsWithCode(1);

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsType<CakeException>(result);
                Assert.Equal("Heat: Process returned an error (exit code 1).", result?.Message);
            }
Beispiel #15
0
            public void Should_Add_Generate_Binder_Variables_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.GenerateBinderVariables = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -wixvar -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #16
0
            public void Should_Add_Generate_Guid_Without_Braces_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.GenerateGuidWithoutBraces = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -g1 -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #17
0
            // Not a Valid Test case based on the fixture setup
            public void Should_Throw_If_Settings_Is_Null()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "settings");
            }
Beispiel #18
0
            public void Should_Add_Keep_Empty_Directories_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.KeepEmptyDirectories = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -ke -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #19
0
            public void Should_Add_File_Harvest_Type_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.HarvestType = WiXHarvestType.File;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("file \"/Working/Cake.dll\" -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #20
0
            public void Should_Add_Content_Output_Group_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.OutputGroup = WiXOutputGroupType.Content;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -pog: content -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #21
0
            public void Should_Add_Extension_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.Extensions = new[] { "WiXSecurityExtensions" };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -ext WiXSecurityExtensions -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #22
0
            public void Should_Add_Project_Name_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.ProjectName = "Cake.Project";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -projectname Cake.Project -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #23
0
            public void Should_Add_Suppress_Specific_Warnings_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.SuppressSpecificWarnings = new[] { "0001", "0002" };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -sw0001 -sw0002 -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #24
0
            public void Should_Add_Suppress_Vb6_Com_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.SuppressVb6Com = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -svb6 -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #25
0
            public void Should_Add_Auto_Generate_Guid_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.AutogeneratedGuid = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -ag -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #26
0
            public void Should_Add_Template_Type_Product_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.Template = WiXTemplateType.Product;

                // When
                var result = fixture.Run();

                //Then
                Assert.Equal("dir \"/Working/src/Cake\" -template product -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #27
0
            public void Should_Add_Configuration_To_Arguments_If_Provided()
            {
                // Given
                var fixture = new HeatFixture();

                fixture.Settings.Configuration = "Release";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("dir \"/Working/src/Cake\" -configuration Release -out \"/Working/cake.wxs\"", result.Args);
            }
Beispiel #28
0
            public void Should_Use_Heat_Runner_From_Tool_Path_If_Provided_On_Windows(string toolPath, string expected)
            {
                // Given
                var fixture = new HeatFixture();
                fixture.Settings.ToolPath = toolPath;
                fixture.GivenSettingsToolPathExist();

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal(expected, result.Path.FullPath);
            }