Ejemplo n.º 1
0
        public void Parse_SucceedsWithParameters()
        {
            var definition = OptionsDefinition.GetDefinition <WithParameters>();

            var parsed = (WithParameters)definition.Parse("--version=hello", "--include", "sys.obj");

            Assert.That(parsed.Version, Is.EqualTo("hello"));
            Assert.That(parsed.Include, Is.EqualTo("sys.obj"));
        }
Ejemplo n.º 2
0
        public void Parse_SucceedsWithCommands()
        {
            var definition = OptionsDefinition.GetDefinition <WithCommands>();

            var parsed = (WithCommands)definition.Parse("InnerCommand1");

            Assert.That(parsed.Command1, Is.Not.Null);
            Assert.That(parsed.Command2, Is.Null);
        }
Ejemplo n.º 3
0
        public void Parse_SucceedsWithNestedParameters()
        {
            var definition = OptionsDefinition.GetDefinition <WithNestedParameters>();

            var parsed = (WithNestedParameters)definition.Parse("OuterCommand2", "--version=hello", "--include", "sys.obj");

            Assert.That(parsed.Command1, Is.Null);
            Assert.That(parsed.Command2, Is.Not.Null);
            Assert.That(parsed.Command2.Version, Is.EqualTo("hello"));
            Assert.That(parsed.Command2.Include, Is.EqualTo("sys.obj"));
        }