public void TestAverageValueOfLengthOfWordsInAList() { double expected, actual; TextAnalyst frm = new TextAnalyst(); expected = 4.0; actual = frm.GetAverageWordLength(new List <string> { "The", "Quick", "Brown", "Quick", "Fox", "Jumps", "Over", "The", "Lazy", "Dog" }); Assert.AreEqual(expected, actual); }
public void TestListOfShortestWords() { List <string> expected = new List <string> { "The", "Fox", "Dog" }; TextAnalyst frm = new TextAnalyst(); List <string> actual = frm.GetShortestWords(new List <string> { "The", "Quick", "Brown", "Quick", "Fox", "Jumps", "Over", "The", "Lazy", "Dog" }); CollectionAssert.AreEqual(expected, actual); }
public void TestListOfShortestWordsWithWordsTheSameLength() { List <string> expected = new List <string> { "The", "Cat", "And", "Dog" }; TextAnalyst frm = new TextAnalyst(); List <string> actual = frm.GetShortestWords(new List <string> { "The", "Cat", "And", "Dog" }); CollectionAssert.AreEqual(expected, actual); }
public void TestNumberOfWordsOfACertainLengthInDocumentDifferentCase() { int expected, actual; expected = 2; TextAnalyst frm = new TextAnalyst(); actual = frm.GetNumberOfOccurancesOfWordInWordList("The", new List <string> { "the", "Quick", "Brown", "Quick", "Fox", "Jumps", "Over", "The", "Lazy", "Dog" }); Assert.AreEqual(expected, actual); }
public void TestCountOfWordsOfCertainLength() { List <string> expected = new List <string> { "Quick", "Brown", "Jumps" }; TextAnalyst frm = new TextAnalyst(); List <string> actual = frm.GetWordsOfLength(5, new List <string> { "The", "Quick", "Brown", "Quick", "Fox", "Jumps", "Over", "The", "Lazy", "Dog" }); CollectionAssert.AreEqual(expected, actual); }