Ejemplo n.º 1
0
        public void Should_Find_Paket_Executable_If_Tool_Path_Not_Provided()
        {
            // Given
            var fixture = new PaketPusherFixture();

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

            // Then
            result.Path.FullPath.Should().Be("/Working/tools/paket.exe");
        }
Ejemplo n.º 2
0
        public void Should_Set_WorkingDirectory()
        {
            // Given
            var fixture = new PaketPusherFixture();

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

            // Then
            result.Process.WorkingDirectory.FullPath.Should().Be("/Working");
        }
Ejemplo n.º 3
0
        public void Should_Set_File()
        {
            // Given
            var fixture = new PaketPusherFixture();

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

            // Then
            result.Args.Should().Be(@"push file ""/Working/NuGet/foo.nupkg""");
        }
Ejemplo n.º 4
0
        public void Should_Throw_If_Paket_Executable_Was_Not_Found()
        {
            // Given
            var fixture = new PaketPusherFixture();

            fixture.GivenDefaultToolDoNotExist();

            // When
            Action result = () => fixture.Run();

            // Then
            result.ShouldThrow <CakeException>().WithMessage("Could not locate paket.exe.");
        }
Ejemplo n.º 5
0
        public void Should_Set_Url()
        {
            // Given
            var fixture = new PaketPusherFixture {
                Settings = { Url = "www.google.com" }
            };

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

            // Then
            result.Args.Should().Be(@"push file ""/Working/NuGet/foo.nupkg"" url ""www.google.com""");
        }
Ejemplo n.º 6
0
        public void Should_Set_EndPoint()
        {
            // Given
            var fixture = new PaketPusherFixture {
                Settings = { EndPoint = "/api/v3/package" }
            };

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

            // Then
            result.Args.Should().Be(@"push file ""/Working/NuGet/foo.nupkg"" endpoint ""/api/v3/package""");
        }
Ejemplo n.º 7
0
        public void Should_Set_ApiKey()
        {
            // Given
            var fixture = new PaketPusherFixture {
                Settings = { ApiKey = "00000000-0000-0000-0000-000000000000" }
            };

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

            // Then
            result.Args.Should().Be(@"push file ""/Working/NuGet/foo.nupkg"" apikey ""00000000-0000-0000-0000-000000000000""");
        }
Ejemplo n.º 8
0
        public void Should_Throw_If_Settings_Are_Null()
        {
            // Given
            var fixture = new PaketPusherFixture {
                Settings = null
            };

            // When
            Action result = () => fixture.Run();

            // Then
            result.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("settings");
        }
Ejemplo n.º 9
0
        public void Should_Throw_If_Process_Was_Not_Started()
        {
            // Given
            var fixture = new PaketPusherFixture();

            fixture.GivenProcessCannotStart();

            // When
            Action result = () => fixture.Run();

            // Then
            result.ShouldThrow <CakeException>().WithMessage("Paket: Process was not started.");
        }
Ejemplo n.º 10
0
        public void Should_Throw_If_Process_Has_A_Non_Zero_ExitCode()
        {
            // Given
            var fixture = new PaketPusherFixture();

            fixture.GivenProcessExitsWithCode(1);

            // When
            Action result = () => fixture.Run();

            // Then
            result.ShouldThrow <CakeException>().WithMessage("Paket: Process returned an error (exit code 1).");
        }
        public void Should_Throw_If_FilePath_Is_Null()
        {
            // Given
            var fixture = new PaketPusherFixture {
                FilePath = null
            };

            // When
            Action result = () => fixture.Run();

            // Then
            result.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("filePath");
        }
Ejemplo n.º 12
0
        public void Should_Use_Paket_Executable_From_Tool_Path_If_Provided(string toolPath, string expected)
        {
            // Given
            var fixture = new PaketPusherFixture {
                Settings = { ToolPath = toolPath }
            };

            fixture.GivenSettingsToolPathExist();

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

            // Then
            result.Path.FullPath.Should().Be(expected);
        }