//ISSUE https://github.com/dotnet/cli/issues/1935
        // This fact technically succeeds on Windows, but it causes a crash dialog to pop, which interrupts the build.
        //[WindowsOnlyFact]
        public void It_returns_a_failure_when_it_fails_to_run_the_tests()
        {
            var testCommand = new DotnetTestCommand();
            var result      = testCommand.ExecuteWithCapturedOutput(
                $"{_projectFilePath} -o {Path.Combine(AppContext.BaseDirectory, "nonExistingFolder")} --no-build");

            result.Should().Fail();
        }
Exemplo n.º 2
0
        public void It_builds_and_runs_tests_for_netcoreapp10()
        {
            var testCommand = new DotnetTestCommand();
            var result      = testCommand
                              .ExecuteWithCapturedOutput($"{_projectFilePath} -f netcoreapp1.0");

            result.Should().Pass();
            result.StdOut.Should().Contain($"Skipped for NETCOREAPP1.0");
            result.StdOut.Should().NotContain($"Skipped for NET451");
        }
Exemplo n.º 3
0
        public void It_prints_error_when_no_framework_matched()
        {
            var nonExistentFramework = "doesnotexisttfm99.99";
            var testCommand          = new DotnetTestCommand();
            var result = testCommand
                         .ExecuteWithCapturedOutput($"{_projectFilePath} -f {nonExistentFramework}");

            result.Should().Fail();
            result.StdErr.Should().Contain($"does not support framework");
        }
Exemplo n.º 4
0
        public void It_builds_and_runs_tests_for_all_frameworks()
        {
            var testCommand = new DotnetTestCommand();
            var result      = testCommand
                              .ExecuteWithCapturedOutput($"{_projectFilePath}");

            result.Should().Pass();
            result.StdOut.Should().Contain("Skipped for NET46");
            result.StdOut.Should().Contain("Skipped for NETCOREAPP1.0");
        }
Exemplo n.º 5
0
        public void It_runs_tests_for_all_tfms_if_they_fail()
        {
            var testCommand = new DotnetTestCommand
            {
                Environment =
                {
                    { "DOTNET_TEST_SHOULD_FAIL", "1" }
                }
            };

            var result = testCommand
                         .ExecuteWithCapturedOutput($"{_projectFilePath}");

            result.Should().Fail();
            result.StdOut.Should().Contain("Failing in NET451");
            result.StdOut.Should().Contain("Failing in NETCOREAPP1.0");
        }