public void Contains_cannot_see_entry_received_before_journal_deletion() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source, null); source.AddMessage("name", "message before delete", new ObjectId(0), 0); journal.Delete(); journal.Contains("message before delete").Should().BeFalse(); }
public void Can_see_entry_received_after_journal_deletion() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source, null); source.AddMessage("name", "first message", new ObjectId(0), 0); journal.Delete(); source.AddMessage("name", "message after delete", new ObjectId(0), 0); journal.Contains("message after delete").Should().BeTrue(); }
public void WaitAny_cannot_see_entry_received_before_journal_deletion() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source, null); source.AddMessage("name", "message before delete", new ObjectId(0), 0); journal.Delete(); bool canSeeMessageBeforeDelete = false; journal.When("message before delete", e => canSeeMessageBeforeDelete = true) .WhenTimeout(() => { }) .WaitAny(TimeSpan.FromMilliseconds(1)); canSeeMessageBeforeDelete.Should().BeFalse(); }