示例#1
0
        public void TestVal2()
        {
            var p = new CmdArgs.CmdArgsParser <Conf>();

            Assert.Throws <CmdException>(() =>
                                         p.ParseCommandLine(new[] { "-s", "--dummy", "val" }));
        }
示例#2
0
        public void TestIgnoreCase()
        {
            var p = new CmdArgs.CmdArgsParser <Conf>();

            Res <Conf> rv = p.ParseCommandLine(new[] { "--DUMMY" });

            Check(rv, s: false, d: true);
        }
示例#3
0
        public void TestLongname()
        {
            var p = new CmdArgs.CmdArgsParser <Conf>();

            Res <Conf> rv = p.ParseCommandLine(new[] { "--dummy" });

            Check(rv, s: false, d: true);
        }
示例#4
0
        public void TestTwoInOne1()
        {
            var p = new CmdArgs.CmdArgsParser <Conf>();

            Res <Conf> rv = p.ParseCommandLine(new[] { "-ds" });

            Check(rv, s: true, d: true);
        }
示例#5
0
        public void TestShortnameCase()
        {
            var p = new CmdArgs.CmdArgsParser <Conf>
            {
                AllowUnknownArguments = false
            };

            Assert.Throws <CmdException>(() => p.ParseCommandLine(new[] { "-S" }));
        }
示例#6
0
        public void TestShortname2()
        {
            var p = new CmdArgs.CmdArgsParser <Conf>
            {
                AllowUnknownArguments = true
            };

            Res <Conf> rv = p.ParseCommandLine(new[] { "-d" });

            Check(rv, s: false, d: true);
        }