Exemplo n.º 1
0
            public void Should_Add_Mandatory_Arguments()
            {
                // Given
                var fixture = new DotNetCoreRunnerFixture();

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

                // Then
                Assert.Equal("run", result.Args);
            }
Exemplo n.º 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);
            }
Exemplo n.º 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);
            }
Exemplo n.º 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);
            }
Exemplo n.º 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);
            }
Exemplo n.º 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).");
            }
Exemplo n.º 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.");
            }
Exemplo n.º 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");
            }
Exemplo n.º 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);
            }