Ejemplo n.º 1
0
            public void ToCommand_ProperOptionCount2()
            {
                var a           = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand2, SharedAzmiArgumentsClass>();
                var actualCount = a.Options.Count();

                Assert.Equal(2, actualCount);
            }
Ejemplo n.º 2
0
            public void ToCommand_ProperMultiValuedOption()
            {
                var subCommand  = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand2, SharedAzmiArgumentsClass>();
                var option      = subCommand.Options.First(a => a.Name == "exclude");
                var actualArity = option.Argument.Arity;

                Assert.Equal(ArgumentArity.OneOrMore.MinimumNumberOfValues, actualArity.MinimumNumberOfValues);
                Assert.Equal(ArgumentArity.OneOrMore.MaximumNumberOfValues, actualArity.MaximumNumberOfValues);
                // TODO: use one Assert above, simple Equal is not working for objects
            }
Ejemplo n.º 3
0
            public void ToCommand_ProperType2()
            {
                var a = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand2, SharedAzmiArgumentsClass>();

                Assert.IsType <Command>(a);
            }
Ejemplo n.º 4
0
            public void ToCommand_HandlerProperType()
            {
                var a = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand, SharedAzmiArgumentsClass>();

                Assert.IsAssignableFrom <ICommandHandler>(a.Handler);
            }
Ejemplo n.º 5
0
            public void ToCommand_ProperOptionName()
            {
                var a = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand, SharedAzmiArgumentsClass>();

                Assert.Equal("identity", a.Options.First <Option>().Name);
            }
Ejemplo n.º 6
0
            public void ToCommand_ProperOptionCount()
            {
                var a = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand, SharedAzmiArgumentsClass>();

                Assert.Single(a.Options);
            }
Ejemplo n.º 7
0
            public void ToCommand_ProperName()
            {
                var a = AzmiCommandLineExtensions.ToCommand <DummyAzmiCommand, SharedAzmiArgumentsClass>();

                Assert.Equal("dummy_command", a.Name);
            }