Exemplo n.º 1
0
        public void Can_delete_journal_and_All_handles_next_event()
        {
            var source  = new EventJournalSource();
            var journal = new EventJournal(source);

            bool eventBeforeDeleteHandled = false;
            bool eventAfterDeleteHandled  = false;

            source.Publish(new SpeechRequestedEvent("event that should be deleted"));
            journal.Delete();
            source.Publish(new QuestArrowEvent(true, new Location2D(123, 321)));

            journal.When <SpeechRequestedEvent>(e => eventBeforeDeleteHandled = true)
            .When <QuestArrowEvent>(e => eventAfterDeleteHandled = true)
            .All();

            eventBeforeDeleteHandled.Should().BeFalse();
            eventAfterDeleteHandled.Should().BeTrue();
        }