public void ShouldParsePositionalValues()
        {
            var args    = new [] { "value", "value-2" };
            var parser  = new OptionsParser();
            var options = new OptionsWithPositionalValues();

            parser.Parse(options, args);

            Assert.AreEqual(1, parser.Values.Count());
            Assert.AreEqual(1, parser.UnexpectedArguments.Count());

            Assert.AreEqual("value", options.Value);
            Assert.AreEqual("value-2", parser.UnexpectedArguments.First().Value);
        }
Beispiel #2
0
        public void ShouldParsePositionalValues()
        {
            var args = new [] { "value", "value-2" };
            var parser = new OptionsParser();
            var options = new OptionsWithPositionalValues();
            parser.Parse(options, args);

            Assert.AreEqual(1, parser.Values.Count());
            Assert.AreEqual(1, parser.UnexpectedArguments.Count());

            Assert.AreEqual("value", options.Value);
            Assert.AreEqual("value-2", parser.UnexpectedArguments.First().Value);
        }