public void ComposesArgumentsForOptionalNamedArguments() { this.AddNamedArgument("name", "placeholder", null, Optional <IEnumerable <string> > .CreateNotSet()); Usage result = this.testee.Compose(); result.Arguments.Should().Be("[-name <placeholder>]"); }
public void ComposesOptionsForNamedArguments() { this.AddNamedArgument("name", "placeholder", "description", Optional <IEnumerable <string> > .CreateNotSet()); Usage result = this.testee.Compose(); result.Options.Should().Be(Lines("-name <placeholder>\tdescription")); }
public void ComposesArgumentsForSeveralArgumentsInOrderOfDeclaration() { var namedArgument = this.AddNamedArgument("named", "value", "description_named", Optional <IEnumerable <string> > .CreateNotSet()); this.AddpositionalArgument("placeholder", "description_positional"); this.AddSwitch("switch", "description_switch"); this.AddNamedArgument("other", "other", "description_other", Optional <IEnumerable <string> > .CreateNotSet()); this.requiredArguments.Add(namedArgument); Usage result = this.testee.Compose(); result.Arguments.Should().Be("-named <value> [<placeholder>] [-switch] [-other <other>]"); }
public void ComposesOptionsForSeveralArgumentsInOrderOfDeclaration() { this.AddNamedArgument("named", "value", "description_named", Optional <IEnumerable <string> > .CreateNotSet()); this.AddpositionalArgument("placeholder", "description_positional"); this.AddSwitch("switch", "description_switch"); this.AddNamedArgument("other", "other", "description_other", Optional <IEnumerable <string> > .CreateNotSet()); Usage result = this.testee.Compose(); result.Options.Should().Be(Lines( "-named <value>\tdescription_named", "<placeholder>\tdescription_positional", "-switch\tdescription_switch", "-other <other>\tdescription_other")); }
public void ComposesArgumentsForRequiredNamedArguments() { NamedArgument <string> namedArgument = this.AddNamedArgument("name", "placeholder", null, Optional <IEnumerable <string> > .CreateNotSet()); this.requiredArguments.Add(namedArgument); Usage result = this.testee.Compose(); result.Arguments.Should().Be("-name <placeholder>"); }
public void ComposesOptionsForNamedArguments_WithAlias() { NamedArgument <string> namedArgument = this.AddNamedArgument("name", "placeholder", "description", Optional <IEnumerable <string> > .CreateNotSet()); this.longAliases.Add("alias", namedArgument); this.longAliases.Add("other_alias", namedArgument); Usage result = this.testee.Compose(); result.Options.Should().Be(Lines("-name <placeholder> (--alias, --other_alias)\tdescription")); }