Expose raw arguments on the command context

This commit is contained in:
Patrik Svensson
2024-04-20 14:11:03 +02:00
committed by Patrik Svensson
parent de04619f88
commit 95bff47b85
6 changed files with 62 additions and 11 deletions

View File

@ -0,0 +1,23 @@
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" });
}
}