コード例 #1
0
            public void Should_Add_Mandatory_Arguments()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

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

                // Then
                Assert.Equal("run", result.Args);
            }
コード例 #2
0
            public void Should_Add_Additional_Settings()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

                fixture.Settings.Framework     = "dnxcore50";
                fixture.Settings.Configuration = "Release";
                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("run --framework dnxcore50 --configuration Release", result.Args);
            }
コード例 #3
0
            public void Should_Add_Path_Arguments()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

                fixture.Project   = "./tools/tool/";
                fixture.Arguments = "--args=\"value\"";
                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("run --project \"./tools/tool/\" -- --args=\"value\"", result.Args);
            }
コード例 #4
0
            public void Should_Add_Host_Arguments()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

                fixture.Settings.DiagnosticOutput = true;

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

                // Then
                Assert.Equal("--diagnostics run", result.Args);
            }
コード例 #5
0
            public void Should_Add_RollForward_Arguments(DotNetCoreRollForward rollForward, string expected)
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

                fixture.Settings.RollForward = rollForward;

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

                // Then
                Assert.Equal(expected, result.Args);
            }
コード例 #6
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

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

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

                // Then
                Assert.IsCakeException(result, ".NET Core CLI: Process returned an error (exit code 1).");
            }
コード例 #7
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

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

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

                // Then
                Assert.IsCakeException(result, ".NET Core CLI: Process was not started.");
            }
コード例 #8
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

                fixture.Project  = "./src/*";
                fixture.Settings = null;
                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                Assert.IsArgumentNullException(result, "settings");
            }
コード例 #9
0
            public void Should_Add_Additional_Settings()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

                fixture.Settings.Framework     = "dnxcore50";
                fixture.Settings.Configuration = "Release";
                fixture.Settings.Runtime       = "win7-x86";
                fixture.Settings.Sources       = new[] { "https://api.nuget.org/v3/index.json" };
                fixture.Settings.RollForward   = DotNetCoreRollForward.Major;

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

                // Then
                Assert.Equal("run --framework dnxcore50 --configuration Release --runtime win7-x86 --source \"https://api.nuget.org/v3/index.json\" --roll-forward Major", result.Args);
            }