mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Allow mixed naming when setting an option to multiple values
This commit is contained in:
@@ -910,6 +910,28 @@ namespace CliFx.Tests
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Property_annotated_as_an_option_can_be_bound_from_multiple_values_even_if_the_inputs_use_mixed_naming()
|
||||
{
|
||||
// Arrange
|
||||
var schema = ApplicationSchema.Resolve(new[] {typeof(ArrayOptionCommand)});
|
||||
|
||||
var input = new CommandLineInputBuilder()
|
||||
.AddOption("option", "foo")
|
||||
.AddOption("o", "bar")
|
||||
.AddOption("option", "baz")
|
||||
.Build();
|
||||
|
||||
// Act
|
||||
var command = schema.InitializeEntryPoint(input);
|
||||
|
||||
// Assert
|
||||
command.Should().BeEquivalentTo(new ArrayOptionCommand
|
||||
{
|
||||
Option = new[] {"foo", "bar", "baz"}
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Property_annotated_as_a_required_option_must_always_be_bound_to_some_value()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user