mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
Expose raw arguments on the command context
This commit is contained in:

committed by
Patrik Svensson

parent
de04619f88
commit
95bff47b85
@ -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" });
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user