Ejemplo n.º 1
0
        public void IsSatisfied_ShouldBeTrueForSubgroupOption()
        {
            var root = new OptionGroup()
                       .WithGroup("inspec", inspecGroup =>
            {
                inspecGroup.WithOption(new FakeOption("install"), "install");
                inspecGroup.WithOption(new FakeOption("status"), "status");
            });

            root.IsSatisfiedBy(ToCommandArguments("inspec", "install")).Should().BeTrue("because the child group should be used");
        }
Ejemplo n.º 2
0
        public static bool IsSatsifiedBy(this OptionGroup optionGroup, params string[] args)
        {
            var arguments = args.ToList().Select(a => new CommandArgument(a)).ToArray();

            return(optionGroup.IsSatisfiedBy(arguments));
        }
Ejemplo n.º 3
0
        private static bool IsSatisfiedBy(OptionGroup group, params string[] commands)
        {
            var arguments = commands.Select(Argument.CreateCommand).ToArray();

            return(group.IsSatisfiedBy(arguments));
        }