Esempio n. 1
0
File: Tests.cs Progetto: kurtaj/CLAP
        public void RegisterHelpHandler_MoreThanOnce_SameKey_Exception()
        {
            var p = new Parser<Sample_25>();

            p.RegisterHelpHandler("a", delegate { });
            p.RegisterHelpHandler("b", delegate { });
            p.RegisterHelpHandler("a", delegate { });
        }
Esempio n. 2
0
File: Tests.cs Progetto: kurtaj/CLAP
        public void Help_Registered()
        {
            var mock = new Mock<IPrinter>();
            var sample = new Sample_11 { Printer = mock.Object };

            var p = new Parser<Sample_11>();

            p.RegisterHelpHandler("help", s => sample.Print());

            p.Run("-help".Split(' '), sample);
            p.Run("help".Split(' '), sample);

            mock.Verify(o => o.Print("x"), Times.Exactly(2));
        }