Beispiel #1
0
        public void TestEventListenerUnbinds()
        {
            _eventContext.ContextBindEventListener(EventKey.Test, _subListener1);
            _eventContext.TriggerEvent(EventKey.Test, new EventPayload("null", null));
            _eventContext.ContextRemoveEventListener(EventKey.Test, _subListener1);
            _eventContext.TriggerEvent(EventKey.Test, new EventPayload("null", null));
            _eventContext.TriggerEvent(EventKey.Test, new EventPayload("null", null));

            //Assert
            _subListener1.Received(1).ReceiveEvent(_eventContext.GetEvent(EventKey.Test), Arg.Any <EventPayload>());
        }