public void Given_text_marked_as_spam_then_marked_as_ham()
        {
            var detector = new SpamDetector();
            var spamCorpus = Corpus.OfText("this is totally NOT spam");
            detector.SpamFound(spamCorpus);
            detector.HamFound(spamCorpus);

            Assert.That(!detector.IsSpam(spamCorpus), "should not be spam");
        }
        public void Given_text_that_has_an_equivalent_number_of_ham_and_spam()
        {
            var detector = new SpamDetector();
            var ham = Corpus.OfText("a b");
            var spam = Corpus.OfText("c d");

            detector.HamFound(ham);
            detector.SpamFound(spam);

            var result = detector.IsSpam(Corpus.OfText("a b c d"));

            Assert.That(!result, "should not be spam");
        }
        public void Given_a_corpus_that_is_heavily_weighted_towards_being_spam()
        {
            var ham = Corpus.OfText("a b");
            var spam = Corpus.OfText("a b c d");

            var detector = new SpamDetector();
            detector.HamFound(ham);
            detector.SpamFound(spam);

            var result = detector.IsSpam(Corpus.OfText("a b c d"));

            Assert.That(result, "should be spam.");
        }
        public void Given_text_that_has_known_ham_and_unknown_words()
        {
            var detector = new SpamDetector();
            var ham = Corpus.OfText("this is totally ham");
            var mysteryMeat = Corpus.OfText("this is all wtf");

            detector.HamFound(ham);

            var result = detector.IsSpam(mysteryMeat);

            Assert.That(!result, "should be ham");
        }