Ejemplo n.º 1
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code(int exitCode, string expectedMessage)
            {
                // Given
                var fixture = new NUnit3RunnerFixture();

                fixture.GivenProcessExitsWithCode(exitCode);

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal(expectedMessage, result?.Message);
            }
Ejemplo n.º 2
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new NUnit3RunnerFixture();

                fixture.GivenProcessExitsWithCode(1);

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal("NUnit3: Process returned an error (exit code 1).", result.Message);
            }