示例#1
0
            public void Should_Add_Arguments_And_Settings_If_Set()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path     = "./src/*";
                fixture.Settings = new DNUPackSettings
                {
                    Frameworks      = new[] { "dnx451", "dnxcore50" },
                    Configurations  = new[] { "Debug", "Release" },
                    OutputDirectory = "./artifacts/",
                    Quiet           = true
                };

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

                // Then
                Assert.Equal("pack \"./src/*\"" +
                             " --framework \"dnx451;dnxcore50\"" +
                             " --configuration \"Debug;Release\"" +
                             " --out \"/Working/artifacts\"" +
                             " --quiet",
                             result.Args);
            }
示例#2
0
            public void Should_Add_Mandatory_Arguments()
            {
                // Given
                var fixture = new DNUPackerFixture();

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

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

                // Then
                Assert.Equal("pack \"./src/*\"", result.Args);
            }
示例#3
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path = "./src/*";
                fixture.GivenProcessExitsWithCode(1);

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

                // Then
                Assert.IsCakeException(result, "DNU: Process returned an error.");
            }
示例#4
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path = "./src/*";
                fixture.GivenProcessCannotStart();

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

                // Then
                Assert.IsCakeException(result, "DNU: Process was not started.");
            }
示例#5
0
            public void Should_Throw_If_DNU_Executable_Was_Not_Found()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path = "./src/*";
                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                Assert.IsCakeException(result, "DNU: Could not locate executable.");
            }
示例#6
0
            public void Should_Throw_If_Path_Are_Null()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Settings = new DNUPackSettings();
                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                Assert.IsArgumentNullException(result, "path");
            }
示例#7
0
            public void Should_Add_Quiet_If_Set()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path     = "./src/*";
                fixture.Settings = new DNUPackSettings
                {
                    Quiet = true
                };

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

                // Then
                Assert.Equal("pack \"./src/*\" --quiet", result.Args);
            }
示例#8
0
            public void Should_Add_Proxy_If_Set()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path     = "./src/*";
                fixture.Settings = new DNUPackSettings
                {
                    OutputDirectory = "./artifacts/"
                };

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

                // Then
                Assert.Equal("pack \"./src/*\" --out \"/Working/artifacts\"", result.Args);
            }
示例#9
0
            public void Should_Add_Configurations_If_Set()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path     = "./src/*";
                fixture.Settings = new DNUPackSettings
                {
                    Configurations = new[] { "Debug", "Release" }
                };

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

                // Then
                Assert.Equal("pack \"./src/*\" --configuration \"Debug;Release\"", result.Args);
            }
示例#10
0
            public void Should_Add_Frameworks_If_Set()
            {
                // Given
                var fixture = new DNUPackerFixture();

                fixture.Path     = "./src/*";
                fixture.Settings = new DNUPackSettings
                {
                    Frameworks = new[] { "dnx451", "dnxcore50" }
                };

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

                // Then
                Assert.Equal("pack \"./src/*\" --framework \"dnx451;dnxcore50\"", result.Args);
            }