public void Should_Process_Matrices()
        {
            var optionSet = new OptionSet();

            var n = optionSet.AddVariableMatrix <string>("n", "");

            /* Specify the args as an array instead of the splitskies, in particular
             * on account of the Message= use case. Actually, at this level, quotes
             * should not enter into the mix, because those are command-line beasties. */
            var args = new[]
            {
                "-n:Hello=World",
                "-nColor=Red",
                "-n:Message=Hello With Spaces",
                "-n:Name=Jesus",
                "-nFavNHL:NewJerseyDevils",
            };

            optionSet.Parse(args.Select(a => "-" + a.Trim()).ToArray());

            //This runs dangerously close to testing the Options themselves.
            Action <IDictionary <string, string> > verify = x =>
            {
                Assert.AreEqual(3, x.Count());
                Assert.IsTrue(x.ContainsKey("Name"));
                Assert.IsTrue(x.ContainsKey("Hello"));
                Assert.IsTrue(x.ContainsKey("Message"));
                Assert.IsFalse(x.ContainsKey("Color"));
                Assert.IsFalse(x.ContainsKey("FavNHL"));
                Assert.AreEqual(x["Name"], "Jesus");
                Assert.AreEqual(x["Hello"], "World");
            };

            verify(n);
            verify(n.Matrix);
        }
        public void Should_process_matricies()
        {
            var p = new OptionSet();

            var n = p.AddVariableMatrix<string>("n", "");

            var myArgs =
                "-n:Hello=World -n:Color=Red \"-n:Message=Hello With Spaces\" -nName=Ryan -nFavNHL:VancouverCanucks".Split('-');
            p.Parse(myArgs.Select(a => "-" + a.Trim()).ToArray());

            Assert.AreEqual(5, n.Matrix.Count());
            Assert.IsTrue(n.Matrix.ContainsKey("Hello"));
            Assert.IsTrue(n.Matrix.ContainsKey("Color"));
            Assert.IsTrue(n.Matrix.ContainsKey("Message"));
            Assert.AreEqual("Ryan", n.Matrix["Name"]);
            Assert.AreEqual("VancouverCanucks", n.Matrix["FavNHL"]);
        }
        public void Should_Process_Matrices()
        {
            var optionSet = new OptionSet();

            var n = optionSet.AddVariableMatrix<string>("n", "");

            /* Specify the args as an array instead of the splitskies, in particular
             * on account of the Message= use case. Actually, at this level, quotes
             * should not enter into the mix, because those are command-line beasties. */
            var args = new[]
            {
                "-n:Hello=World",
                "-nColor=Red",
                "-n:Message=Hello With Spaces",
                "-n:Name=Jesus",
                "-nFavNHL:NewJerseyDevils",
            };

            optionSet.Parse(args.Select(a => "-" + a.Trim()).ToArray());

            //This runs dangerously close to testing the Options themselves.
            Action<IDictionary<string, string>> verify = x =>
            {
                Assert.AreEqual(3, x.Count());
                Assert.IsTrue(x.ContainsKey("Name"));
                Assert.IsTrue(x.ContainsKey("Hello"));
                Assert.IsTrue(x.ContainsKey("Message"));
                Assert.IsFalse(x.ContainsKey("Color"));
                Assert.IsFalse(x.ContainsKey("FavNHL"));
                Assert.AreEqual(x["Name"], "Jesus");
                Assert.AreEqual(x["Hello"], "World");
            };

            verify(n);
            verify(n.Matrix);
        }