public void RegisterHelpHandler_MoreThanOnce_SameKey_Exception() { var p = new Parser<Sample_25>(); p.RegisterHelpHandler("a", delegate { }); p.RegisterHelpHandler("b", delegate { }); p.RegisterHelpHandler("a", delegate { }); }
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)); }