Пример #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);
        }