public void GetWordCount_OnExecuteWithNull_ThrowsException() { var wordOccurendeCollection = new WordOccurenceCollection { "word" }; wordOccurendeCollection.GetWordCount(null); }
public void GetWordCount_OnExecuteWithWordNotInCollection_ReturnsZero() { var wordOccurendeCollection = new WordOccurenceCollection { "word" }; var result = wordOccurendeCollection.GetWordCount("test"); Assert.AreEqual(0, result); }
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); }