Esempio n. 1
0
        public void ComposesArgumentsForOptionalNamedArguments()
        {
            this.AddNamedArgument("name", "placeholder", null, Optional <IEnumerable <string> > .CreateNotSet());

            Usage result = this.testee.Compose();

            result.Arguments.Should().Be("[-name <placeholder>]");
        }
Esempio n. 2
0
        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"));
        }
Esempio n. 3
0
        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>]");
        }
Esempio n. 4
0
        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"));
        }
Esempio n. 5
0
        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>");
        }
Esempio n. 6
0
        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"));
        }