Esempio n. 1
0
File: Tests.cs Progetto: serra/CLAP
        public void Required()
        {
            var printer = new Printer();
            var sample = new Sample_07 { Printer = printer };

            Parser.Run(new[]
            {
                "print",
                "/prefix:hello",
            }, sample);

            Assert.AreEqual(1, printer.PrintedTexts.Count);
            Assert.AreEqual("HELLO", printer.PrintedTexts[0]);
        }
Esempio n. 2
0
File: Tests.cs Progetto: serra/CLAP
        public void Required_Exception()
        {
            var printer = new Printer();
            var sample = new Sample_07 { Printer = printer };

            Expect(() => Parser.Run(new[]
                                        {
                                            "print",
                                            "/message:world",
                                        }, sample),
                   Throws.InstanceOf<CommandLineParserException>());
        }
Esempio n. 3
0
File: Tests.cs Progetto: kurtaj/CLAP
        public void Required_Exception()
        {
            try
            {
                var printer = new Printer();
                var sample = new Sample_07 { Printer = printer };

                Parser.Run(new[]
                {
                    "print",
                    "/message:world",
                }, sample);

                Assert.Fail();
            }
            catch (CommandLineException)
            {
            }
        }