Skip to content

Commit f63d066

Browse files
committed
#2 added missing test ot Option binding by alias
1 parent 797ca30 commit f63d066

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/CommandLineX.Tests/CommandActionBinderTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ public void Create_binding_to_OneStringOptionCommandAction_with_string_Symbol_gi
100100
binder.TypeBindings.GetUnboundSymbols().Should().BeEmpty();
101101
}
102102

103+
[TestMethod]
104+
public void Create_binding_to_OneStringOptionCommandAction_with_string_Symbol_by_alias_given_Command_with_string_option()
105+
{
106+
var binder = CommandActionBinder<OneStringOptionCommandAction>.Create(new("oneopt")
107+
{
108+
new Option<string>("--very-fancy-option", "--the-option", "-o")
109+
}, () => new());
110+
binder.Should().NotBeNull();
111+
binder.TypeBindings.GetMappings().Should()
112+
.NotBeEmpty()
113+
.And.AllSatisfy(mapping =>
114+
{
115+
mapping.Key.Name.Should().Be("--very-fancy-option");
116+
mapping.Value.Name.Should().Be("TheOption");
117+
});
118+
binder.TypeBindings.GetUnboundSymbols().Should().BeEmpty();
119+
}
120+
103121
[TestMethod]
104122
public void Create_binding_to_OneStringOptionCommandAction_with_unbound_Symbol_given_Command_with_unaliased_string_option()
105123
{

0 commit comments

Comments
 (0)