spectre.console/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Context.cs
2024-04-20 22:17:31 +02:00

23 lines
620 B
C#

namespace Spectre.Console.Tests.Unit.Cli;
public sealed partial class CommandAppTests
{
[Fact]
[Expectation("Should_Expose_Raw_Arguments")]
public void Should_Return_Correct_Text_When_Command_Is_Unknown()
{
// Given
var app = new CommandAppTester();
app.Configure(config =>
{
config.AddCommand<EmptyCommand>("test");
});
// When
var result = app.Run("test", "--foo", "32", "--lol");
// Then
result.Context.ShouldNotBeNull();
result.Context.Arguments.ShouldBe(new[] { "test", "--foo", "32", "--lol" });
}
}