Example #1
0
 public void suspend_then_resume_restores_handlers_to_fire()
 {
     eventMap.MapListener(eventDispatcher, CustomEvent.Type.STARTED, (Action <IEvent>)listenerWithCounter);
     eventMap.MapListener(eventDispatcher, EventType.COMPLETE, (Action <IEvent>)listenerWithCounter);
     eventMap.MapListener(eventDispatcher, EventType.CHANGE, (Action <IEvent>)listenerWithCounter);
     eventMap.Suspend();
     eventMap.Resume();
     eventDispatcher.Dispatch(new CustomEvent(CustomEvent.Type.STARTED));
     eventDispatcher.Dispatch(new Event(EventType.COMPLETE));
     eventDispatcher.Dispatch(new Event(EventType.CHANGE));
     Assert.That(listenerExecutedCount, Is.EqualTo(3));
 }