コード例 #1
0
        public void Test22_EventsWithClass()
        {
            var listener = new CustomListener();
            var app      = new App(
                commandsTypes: new List <Type> {
                typeof(Common.Commands.T22.Command1)
            },
                addDefaultAppHandler: false
                );

            app.AddApplicationHandler(listener);
            app.Console.Out = new StringWriter();
            app.Run("-a Y");

            var output   = app.Console.Out.ToString();
            var expected =
                @"OnBeforeMemberInvoke: a Y
OnAfterMemberInvoke: a: Y
OnBeforeMemberInvoke: Main 
OnAfterMemberInvoke: Main: Main
OnPrint: Main: Main
OnComplete
OnException: Exception!!";

            Assert.True(TestHelper.CompareString(expected, output));
        }