public void GetWordDictRemovesCapitalization() { var req = new GetPageResponse { Content = "<html><body><p>TEsT</p></body></html>" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Equal(1, res["test"]); }
public void GetWordDictPicksUpWordsInMultipleTags() { var req = new GetPageResponse { Content = "<html><body><p>test</p><a>test</a><span>test</span></body></html>" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Equal(3, res["test"]); }
public void GetWordDictReturnsDictWithSingleEntry() { var req = new GetPageResponse { Content = "<html><body><p>testword</p></body></html>" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Equal(1, res["testword"]); }
public void GetWordDictReturnsEmptyDictGivenNoInput() { var req = new GetPageResponse { Content = "" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Empty(res); }
public void GetWordDictResultIsSorted() { var req = new GetPageResponse { Content = "<html><body><p>1 2 2 3 3 3</p></body></html>" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Equal("3", res.First().Key); }
public void GetWordDictRemovesSpecialChars() { var req = new GetPageResponse { Content = "<html><body><p>\n | ( ) - +</p></body></html>" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Empty(res); }
public void GetWordDictBreaksDownSentance() { var req = new GetPageResponse { Content = "<html><body><p>this is a test</p></body></html>" }; var mfw = new MostFrequentWords(); var res = mfw.GetWordDict(req); Assert.Equal(4, res.Count); Assert.Equal(1, res["test"]); }