Пример #1
0
        public void Test_OnConnect()
        {
            var testHandler = new TestHandler();

            var eventManager = new ReflectionEventManager(null);

            eventManager.AddCommandHandler(testHandler);
            eventManager.CallConnect(null);

            Assert.IsTrue(testHandler.HasOnConnectBeenCalled);
            Assert.IsFalse(testHandler.HasBadOnConnectBeenCalled);
        }
Пример #2
0
        public void Test_2OnConnect()
        {
            var testHandler1 = new TestHandler();
            var testHandler2 = new TestHandler();

            var eventManager = new ReflectionEventManager(null);

            eventManager.AddCommandHandler(testHandler1);
            eventManager.AddCommandHandler(testHandler2);
            eventManager.CallConnect(null);

            Assert.IsTrue(testHandler1.HasOnConnectBeenCalled);
            Assert.IsTrue(testHandler2.HasOnConnectBeenCalled);
        }