public void Should_Pass_Case_5() { // Given var resolver = new FakeTypeResolver(); var settings = new OptionVectorSettings(); resolver.Register(settings); var app = new CommandApp(new FakeTypeRegistrar(resolver)); app.Configure(config => { config.PropagateExceptions(); config.AddCommand <OptionVectorCommand>("multi"); }); // When var result = app.Run(new[] { "multi", "--foo", "a", "--foo", "b", "--bar", "1", "--foo", "c", "--bar", "2" }); // Then result.ShouldBe(0); settings.Foo.Length.ShouldBe(3); settings.Foo.ShouldBe(new[] { "a", "b", "c" }); settings.Bar.Length.ShouldBe(2); settings.Bar.ShouldBe(new[] { 1, 2 }); }
public void Should_Be_Able_To_Use_Command_Alias() { // Given var resolver = new FakeTypeResolver(); var settings = new OptionVectorSettings(); resolver.Register(settings); var app = new CommandApp(new FakeTypeRegistrar(resolver)); app.Configure(config => { config.PropagateExceptions(); config.AddCommand <OptionVectorCommand>("multi").WithAlias("multiple"); }); // When var result = app.Run(new[] { "multiple", "--foo", "a" }); // Then result.ShouldBe(0); settings.Foo.Length.ShouldBe(1); settings.Foo.ShouldBe(new[] { "a" }); }