Esempio n. 1
0
        public void GetWordCount_OnExecuteWithNull_ThrowsException()
        {
            var wordOccurendeCollection = new WordOccurenceCollection {
                "word"
            };

            wordOccurendeCollection.GetWordCount(null);
        }
Esempio n. 2
0
        public void GetWordCount_OnExecuteWithWordNotInCollection_ReturnsZero()
        {
            var wordOccurendeCollection = new WordOccurenceCollection {
                "word"
            };

            var result = wordOccurendeCollection.GetWordCount("test");

            Assert.AreEqual(0, result);
        }
Esempio n. 3
0
        public void GetWordCount_OnExecute_ReturnsTheOccurenceOfTheWords()
        {
            var wordOccurendeCollection = new WordOccurenceCollection
            {
                "word",
                "word",
                "word",
                "word",
                "test",
                "test",
                "test"
            };

            var resultForWord = wordOccurendeCollection.GetWordCount("word");
            var resultForTest = wordOccurendeCollection.GetWordCount("test");

            Assert.AreEqual(4, resultForWord);
            Assert.AreEqual(3, resultForTest);
        }