Example #1
0
File: Tests.cs Project: kurtaj/CLAP
        public void Empty_Registered()
        {
            var mock = new Mock<IPrinter>();
            var sample = new Sample_11 { Printer = mock.Object };

            var p = new Parser<Sample_11>();

            p.RegisterEmptyHandler(() => sample.Print());

            p.Run(new string[] { }, sample);

            mock.Verify(o => o.Print("x"));
        }
Example #2
0
File: Tests.cs Project: kurtaj/CLAP
        public void RegisterHelpHandler_MoreThanOnce_Exception()
        {
            var p = new Parser<Sample_25>();

            p.RegisterEmptyHandler(delegate { });
            p.RegisterEmptyHandler(delegate { });
        }