Exemple #1
0
            public void Should_Add_Settings()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Settings.NoBuild             = true;
                fixture.Settings.NoDependencies      = true;
                fixture.Settings.NoRestore           = true;
                fixture.Settings.NoLogo              = true;
                fixture.Settings.Configuration       = "Release";
                fixture.Settings.OutputDirectory     = "./artifacts/";
                fixture.Settings.VersionSuffix       = "rc1";
                fixture.Settings.IncludeSource       = true;
                fixture.Settings.IncludeSymbols      = true;
                fixture.Settings.SymbolPackageFormat = "snupkg";
                fixture.Settings.Serviceable         = true;
                fixture.Settings.Runtime             = "win7-x86";
                fixture.Settings.Verbosity           = DotNetCoreVerbosity.Minimal;
                fixture.Settings.Sources             = new[] { "https://api.nuget.org/v3/index.json" };

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

                // Then
                Assert.Equal("pack --output \"/Working/artifacts\" --no-build --no-dependencies --no-restore --nologo --include-symbols -p:SymbolPackageFormat=snupkg --include-source --configuration Release --version-suffix rc1 --serviceable --runtime win7-x86 --source \"https://api.nuget.org/v3/index.json\" --verbosity minimal", result.Args);
            }
            public void Should_Add_Mandatory_Arguments()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

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

                // Then
                Assert.Equal("pack", result.Args);
            }
            public void Should_Quote_Project_Path(string text, string expected)
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Project = text;

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

                // Then
                Assert.Equal(expected, result.Args);
            }
            public void Should_Add_Project()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Project = "./src/*";

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

                // Then
                Assert.Equal("pack \"./src/*\"", result.Args);
            }
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.GivenProcessExitsWithCode(1);

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

                // Then
                AssertEx.IsCakeException(result, ".NET Core CLI: Process returned an error (exit code 1).");
            }
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.GivenProcessCannotStart();

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

                // Then
                AssertEx.IsCakeException(result, ".NET Core CLI: Process was not started.");
            }
            public void Should_Add_Host_Arguments()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Settings.DiagnosticOutput = true;

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

                // Then
                Assert.Equal("--diagnostics pack", result.Args);
            }
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Settings = null;
                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                AssertEx.IsArgumentNullException(result, "settings");
            }
Exemple #9
0
            public void Should_Add_Settings()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Settings.BuildBasePath   = "./temp/";
                fixture.Settings.NoBuild         = true;
                fixture.Settings.Configuration   = "Release";
                fixture.Settings.OutputDirectory = "./artifacts/";
                fixture.Settings.VersionSuffix   = "rc1";

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

                // Then
                Assert.Equal("pack --output \"/Working/artifacts\" --build-base-path \"/Working/temp\" --no-build --configuration Release --version-suffix rc1", result.Args);
            }
Exemple #10
0
            public void Should_Add_Settings()
            {
                // Given
                var fixture = new DotNetCorePackFixture();

                fixture.Settings.NoBuild         = true;
                fixture.Settings.Configuration   = "Release";
                fixture.Settings.OutputDirectory = "./artifacts/";
                fixture.Settings.VersionSuffix   = "rc1";
                fixture.Settings.IncludeSource   = true;
                fixture.Settings.IncludeSymbols  = true;
                fixture.Settings.Serviceable     = true;
                fixture.Settings.Verbosity       = DotNetCoreVerbosity.Minimal;

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

                // Then
                Assert.Equal("pack --output \"/Working/artifacts\" --no-build --include-symbols --include-source --configuration Release --version-suffix rc1 --serviceable --verbosity Minimal", result.Args);
            }