public void Last_returns_null_when_message_not_found() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source, null); source.AddMessage("name", "this is an AfK check", new ObjectId(0), 0); var entry = journal.Last("qwer"); entry.Should().BeNull(); }
public void Last_checks_whole_message_including_speaker_name() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source, null); source.AddMessage("name", "this is an AfK check", new ObjectId(0), 0); var entry = journal.Last("name: this"); entry.Message.Should().Be("this is an AfK check"); }
public void Last_is_case_insensitive() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source); source.AddMessage("name", "word1 word2", new ObjectId(2), 0); source.AddMessage("name", "WoRd1 WoRd2", new ObjectId(1), 0); source.AddMessage("name", "word5 word6", new ObjectId(0), 0); var entry = journal.Last("word3", "word2"); entry.SpeakerId.Should().Be((ObjectId)1); }
public void Last_returns_last_entry_with_specified_text() { var source = new SpeechJournalSource(); var journal = new SpeechJournal(source); source.AddMessage("name", "word1 word2", new ObjectId(2), 0); source.AddMessage("name", "word1 word2", new ObjectId(1), 0); source.AddMessage("name", "word5 word6", new ObjectId(0), 0); var entry = journal.Last("word3", "word2"); entry.SpeakerId.Should().Be((ObjectId)1); }