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

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

                // Then
                Assert.Equal("/Working/tools/vsce.cmd", result.Path.FullPath);
            }
Beispiel #2
0
            public void Should_Set_Base_Images_Url()
            {
                // Given
                var fixture = new VscePackagerFixture { Settings = { BaseImagesUrl = "http://www.mydomain.com" } };

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

                // Then
                Assert.Equal("package --baseImagesUrl \"http://www.mydomain.com\"", result.Args);
            }
Beispiel #3
0
            public void Should_Set_Output_File()
            {
                // Given
                var fixture = new VscePackagerFixture { Settings = { OutputFilePath = "C:/temp/package.vsix" } };

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

                // Then
                Assert.Equal("package --out \"C:/temp/package.vsix\"", result.Args);
            }
Beispiel #4
0
            public void Should_Use_Vsce_Runner_From_Tool_Path_If_Provided_On_Windows(string toolPath, string expected)
            {
                // Given
                var fixture = new VscePackagerFixture { Settings = { ToolPath = toolPath } };
                fixture.GivenSettingsToolPathExist();

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

                // Then
                Assert.Equal(expected, result.Path.FullPath);
            }
Beispiel #5
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new VscePackagerFixture();
                fixture.GivenProcessExitsWithCode(1);

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

                // Then
                Assert.IsType<CakeException>(result);
                Assert.Equal("Vsce: Process returned an error (exit code 1).", result.Message);
            }
Beispiel #6
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new VscePackagerFixture();
                fixture.GivenProcessCannotStart();

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

                // Then
                Assert.IsType<CakeException>(result);
                Assert.Equal("Vsce: Process was not started.", result.Message);
            }
Beispiel #7
0
            public void Should_Throw_If_Vsce_Runner_Was_Not_Found()
            {
                // Given
                var fixture = new VscePackagerFixture();
                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                Assert.IsType<CakeException>(result);
                Assert.Equal("Vsce: Could not locate executable.", result.Message);
            }