Beispiel #1
0
        public void CountWordOccurrences_VerifyMultipleOccurrencesWithDifferentCase_3()
        {
            int         total          = 0;
            string      word           = "coffee";
            string      sentence       = "I went to Starbucks Coffee and got tea instead of coffee because I don't like coffee";
            WordCounter newWordCounter = new WordCounter(total, word, sentence);

            newWordCounter.CountWordOccurrences();
            Assert.AreEqual(3, newWordCounter.GetTotal());
        }
Beispiel #2
0
        public void CountWordOccurrences_VerifySingleOccurrenceWhenTwoWordsSameExceptApostrophe_1()
        {
            int         total          = 0;
            string      word           = "can't";
            string      sentence       = "I can't believe you can cant.";
            WordCounter newWordCounter = new WordCounter(total, word, sentence);

            newWordCounter.CountWordOccurrences();
            Assert.AreEqual(1, newWordCounter.GetTotal());
        }
Beispiel #3
0
        public void CountWordOccurrences_VerifySingleOccurrence_1()
        {
            int         total          = 0;
            string      word           = "foo";
            string      sentence       = "foo bar";
            WordCounter newWordCounter = new WordCounter(total, word, sentence);

            newWordCounter.CountWordOccurrences();
            System.Console.WriteLine("Get Total in test is " + newWordCounter.GetTotal());
            Assert.AreEqual(1, newWordCounter.GetTotal());
        }