Пример #1
0
        public async Task Application_can_be_created_and_executed_with_string_command(string commandLine, string result, bool interactive, bool containsExecutable)
        {
            // Arrange
            var builder = new CliApplicationBuilder().AddCommand <BenchmarkDefaultCommand>();

            if (interactive)
            {
                builder.UseInteractiveMode();
            }

            // Act
            var(exitCode, stdOut, stdErr) = await builder.BuildAndRunTestAsync(_output, commandLine, containsExecutable, isInputRedirected : interactive);

            // Assert
            exitCode.Should().Be(ExitCodes.Success);
            stdOut.GetString().Should().ContainEquivalentOf(result);
            stdErr.GetString().Should().BeNullOrWhiteSpace();
        }