public void Should_Not_Throw_If_ProjectPath_IsNull()
            {
                // Given
                var fixture = new DotNetCoreToolFixture();

                fixture.Command     = "cake";
                fixture.ProjectPath = null;

                // When
                fixture.Run();
            }
Beispiel #2
0
            public void Should_Throw_If_ProjectPath_IsNull()
            {
                // Given
                var fixture = new DotNetCoreToolFixture();

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

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

                // Then
                AssertEx.IsArgumentNullException(result, "projectPath");
            }
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new DotNetCoreToolFixture();

                fixture.ProjectPath = "./tests/Cake.Common.Tests/";
                fixture.Command     = "xunit";
                fixture.Settings    = new DotNetCoreToolSettings();
                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 DotNetCoreToolFixture();

                fixture.ProjectPath = "./tests/Cake.Common.Tests/";
                fixture.Command     = "xunit";
                fixture.Settings    = new DotNetCoreToolSettings();
                fixture.GivenProcessCannotStart();

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

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

                fixture.ProjectPath = "./tests/Cake.Common.Tests/";
                fixture.Command     = command;

                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                AssertEx.IsArgumentNullException(result, "command");
            }
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new DotNetCoreToolFixture();

                fixture.ProjectPath = "./tests/Cake.Common.Tests/";
                fixture.Command     = "xunit";
                fixture.Settings    = null;

                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                AssertEx.IsArgumentNullException(result, "settings");
            }