コード例 #1
0
        public void Contains_can_restrict_speech_to_specific_speaker()
        {
            var source  = new SpeechJournalSource();
            var journal = new SpeechJournal(source, null);

            source.AddMessage("name", "same message", new ObjectId(1), 0);

            journal.Contains(1, "same message").Should().BeTrue();
            journal.Contains(0, "same message").Should().BeFalse();
        }
コード例 #2
0
        public void Contains_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);

            journal.Contains("name: this").Should().BeTrue();
        }
コード例 #3
0
        public void Contains_returns_false_if_journal_doesnt_contains_string()
        {
            var source  = new SpeechJournalSource();
            var journal = new SpeechJournal(source, null);

            source.AddMessage("name", "this is an AfK check", new ObjectId(0), 0);

            journal.Contains("and now for completely something else").Should().BeFalse();
        }
コード例 #4
0
        public void Can_see_entries_received_after_journal_instantiation()
        {
            var source  = new SpeechJournalSource();
            var journal = new SpeechJournal(source, null);

            source.AddMessage("name", "message after instantiation", new ObjectId(0), 0);

            journal.Contains("message after instantiation").Should().BeTrue();
        }
コード例 #5
0
        public void Contains_is_case_insensitive_by_default()
        {
            var source  = new SpeechJournalSource();
            var journal = new SpeechJournal(source, null);

            source.AddMessage("name", "this is an AfK check", new ObjectId(0), 0);

            journal.Contains("afk").Should().BeTrue();
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        public void Cannot_see_entries_received_before_journal_instantiation()
        {
            var source = new SpeechJournalSource();

            source.AddMessage("name", "message before instantiation", new ObjectId(0), 0, (Color)0);

            var journal = new SpeechJournal(source, null);

            journal.Contains("message before instantiation").Should().BeFalse();
        }
コード例 #8
0
        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();
        }
コード例 #9
0
 public void ContainsWithFullJournal()
 {
     fullJournal.Contains("something that is not really in journal");
 }
コード例 #10
0
 public void ContainsWithEmptyJournal()
 {
     emptyJournal.Contains("some other name");
 }