Exemple #1
0
        public void Should_Set_TemplateFile()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { TemplateFile = "/Working/Template" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --template ""/Working/Template""");
        }
Exemple #2
0
        public void Should_Set_Version()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { Version = "1.0.0" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --version ""1.0.0""");
        }
Exemple #3
0
        public void Should_Set_ProjectUrl()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { ProjectUrl = "www.google.com" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --project-url ""www.google.com""");
        }
Exemple #4
0
        public void Should_Set_ReleaseNotes()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { ReleaseNotes = "Initial Release" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --release-notes ""Initial Release""");
        }
Exemple #5
0
        public void Should_Throw_If_Settings_Are_Null()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = null
            };

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

            // Then
            result.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("settings");
        }
Exemple #6
0
        public void Should_Add_IncludeReferencedProjects()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { IncludeReferencedProjects = true }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --include-referenced-projects");
        }
Exemple #7
0
        public void Should_Set_BuildConfig()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { BuildConfig = "config" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --build-config ""config""");
        }
Exemple #8
0
        public void Should_Throw_If_Process_Was_Not_Started()
        {
            // Given
            var fixture = new PaketPackerFixture();

            fixture.GivenProcessCannotStart();

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

            // Then
            result.ShouldThrow <CakeException>().WithMessage("Paket: Process was not started.");
        }
Exemple #9
0
        public void Should_Add_PinProjectReferences()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { PinProjectReferences = true }
            };

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

            // Then
            result.Args.Should().Be(@"pack output ""/Working/NuGet"" pin-project-references");
        }
Exemple #10
0
        public void Should_Add_Symbols()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { Symbols = true }
            };

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

            // Then
            result.Args.Should().Be(@"pack output ""/Working/NuGet"" symbols");
        }
Exemple #11
0
        public void Should_Add_MinimumFromLockFile()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { MinimumFromLockFile = true }
            };

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

            // Then
            result.Args.Should().Be(@"pack output ""/Working/NuGet"" minimum-from-lock-file");
        }
Exemple #12
0
        public void Should_Add_LockDependencies()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { LockDependencies = true }
            };

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

            // Then
            result.Args.Should().Be(@"pack output ""/Working/NuGet"" lock-dependencies");
        }
Exemple #13
0
        public void Should_Set_SpecificVersion()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { SpecificVersion = "Cake.Foo 0.0.0" }
            };

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

            // Then
            result.Args.Should().Be(@"pack output ""/Working/NuGet"" specific-version ""Cake.Foo 0.0.0""");
        }
Exemple #14
0
        public void Should_Throw_If_Paket_Executable_Was_Not_Found()
        {
            // Given
            var fixture = new PaketPackerFixture();

            fixture.GivenDefaultToolDoNotExist();

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

            // Then
            result.ShouldThrow <CakeException>().WithMessage("Could not locate paket.exe.");
        }
Exemple #15
0
        public void Should_Set_BuildPlatform()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { BuildPlatform = "net45" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --build-platform ""net45""");
        }
Exemple #16
0
        public void Should_Throw_If_Process_Has_A_Non_Zero_ExitCode()
        {
            // Given
            var fixture = new PaketPackerFixture();

            fixture.GivenProcessExitsWithCode(1);

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

            // Then
            result.ShouldThrow <CakeException>().WithMessage("Paket: Process returned an error (exit code 1).");
        }
Exemple #17
0
        public void Should_Set_Exclude()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { Exclude = "Cake.Foo" }
            };

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

            // Then
            result.Args.Should().Be(@"pack ""/Working/NuGet"" --exclude ""Cake.Foo""");
        }
Exemple #18
0
        public void Should_Throw_If_Output_Is_Null()
        {
            // Given
            var fixture = new PaketPackerFixture {
                Output = null
            };

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

            // Then
            result.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("output");
        }
Exemple #19
0
        public void Should_Use_Paket_Executable_From_Tool_Path_If_Provided(string toolPath, string expected)
        {
            // Given
            var fixture = new PaketPackerFixture {
                Settings = { ToolPath = toolPath }
            };

            fixture.GivenSettingsToolPathExist();

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

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