Exemple #1
0
        public void AbortFirstEvent_DoesNothingWhenQueueIsEmpty()
        {
            var em = new EventManager();

            em.Initialize();
            em.PostInitialize();

            var result = em.AbortFirstEvent <EventStub>();

            Assert.IsFalse(result);
        }
Exemple #2
0
        public void AbortFirstEvent_AbortsFirstOfMultipleTypes()
        {
            var em = new EventManager();

            em.Initialize();
            em.PostInitialize();
            var @event = new EventStub();

            em.QueueEvent(@event);
            em.QueueEvent(new EventStub2());

            var result = em.AbortFirstEvent <EventStub2>();

            Assert.IsTrue(result);
            Assert.AreEqual(1, em.PendingEvents.Count);
            Assert.AreSame(@event, em.PendingEvents.First());
        }