コード例 #1
0
        public void FindWordCount_CheckIfWordsMatchPluralES_int()
        {
            RepeatCounter newCounter = new RepeatCounter("machine", "machines");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(1, result);
        }
コード例 #2
0
        public void FindWordCount_CheckIfWordsMatchPluralIES_int()
        {
            RepeatCounter newCounter = new RepeatCounter("puppy", "PUPPIES");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(1, result);
        }
コード例 #3
0
        public void FindWordCount_CheckIfWordsMatchPunctInWordToMatch_int()
        {
            RepeatCounter newCounter = new RepeatCounter("cat", ".c.A.t.,");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(1, result);
        }
コード例 #4
0
        public void FindWordCount_CheckIfWordsMatchPunctInBothArguemts_int()
        {
            RepeatCounter newCounter = new RepeatCounter("c...a!t", ".c.A.t.,");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(1, result);
        }
コード例 #5
0
        public void FindWordCount_CheckCountOfWordInSentence4WithPunct_int()
        {
            RepeatCounter newCounter = new RepeatCounter("blah", "Blah blah, other bl4h. Wait, that's not a bla.h. But will bla.h count?");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(4, result);
        }
コード例 #6
0
        public void FindWordCount_CheckIfWordMatchCaps_int()
        {
            RepeatCounter newCounter = new RepeatCounter("cat", "Cat");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(1, result);
        }
コード例 #7
0
        public void FindWordCount_CheckCountOfWordInSentence8_int()
        {
            RepeatCounter newCounter = new RepeatCounter("buffalo", "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(8, result);
        }
コード例 #8
0
        public void FindWordCount_CheckCountOfWordInSentence4_int()
        {
            RepeatCounter newCounter = new RepeatCounter("cat", "Cat, the cat, plays with toys for cats and dogs, even though she is a cat, not a dog.");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(4, result);
        }
コード例 #9
0
        public void FindWordCount_CheckCountOfWordInSentence2_int()
        {
            RepeatCounter newCounter = new RepeatCounter("cat", "Once a cat, always a cat.");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(2, result);
        }
コード例 #10
0
        public void FindWordCount_CheckCountOfWordInSentence0_int()
        {
            RepeatCounter newCounter = new RepeatCounter("cat", "I like cats.");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(0, result);
        }
コード例 #11
0
        public void FindWordCount_CheckCountOfWordInSentence1_int()
        {
            RepeatCounter newCounter = new RepeatCounter("cat", "I am not a cat");

            newCounter.FindWordCount();
            int result = newCounter.WordCount;

            Assert.AreEqual(1, result);
        }