예제 #1
0
            public void Should_Find_Gem_Executable_If_Tool_Path_Not_Provided()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

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

                // Then
                Assert.Equal("/Working/tools/gem.bat", result.Path.FullPath);
            }
예제 #2
0
            public void Should_Add_Debug_To_Arguments_If_Set()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.Settings.Debug = true;

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

                // Then
                Assert.Equal("build \"c:/temp/text.config\" --debug", result.Args);
            }
예제 #3
0
            public void Should_Add_Config_File_To_Arguments_If_Set()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.Settings.ConfigFilePath = "test.config";

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

                // Then
                Assert.Equal("build \"c:/temp/text.config\" --config-file \"/Working/test.config\"", result.Args);
            }
예제 #4
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.GivenProcessExitsWithCode(1);

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal("Gem: Process returned an error (exit code 1).", result.Message);
            }
예제 #5
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.GivenProcessCannotStart();

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal("Gem: Process was not started.", result.Message);
            }
예제 #6
0
            public void Should_Use_Tfx_Executable_From_Tool_Path_If_Provided(string toolPath, string expected)
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.Settings.ToolPath = toolPath;
                fixture.GivenSettingsToolPathExist();

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

                // Then
                Assert.Equal(expected, result.Path.FullPath);
            }
예제 #7
0
            public void Should_Throw_If_Gem_Executable_Was_Not_Found()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal("Gem: Could not locate executable.", result.Message);
            }
예제 #8
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.Settings = null;

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

                // Then
                Assert.IsType <ArgumentNullException>(result);
                Assert.Equal("settings", ((ArgumentNullException)result).ParamName);
            }
예제 #9
0
            public void Should_Throw_If_GemSpec_File_Is_Null()
            {
                // Given
                var fixture = new GemBuildRunnerFixture();

                fixture.GemSpecFilePath = null;

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

                // Then
                Assert.IsType <ArgumentNullException>(result);
                Assert.Equal("gemSpecFilePath", ((ArgumentNullException)result).ParamName);
            }