public void GetListOfClosestWordsFuncTest() { // arrange ILevenshteinDistance levDist = new WagnerFischer(); List<string> origWords = new List<string>() { "First", "Second", "Third", "Fourth", "Fifth", "Sixth" }; MockDictionaryFileFiller filler = new MockDictionaryFileFiller(origWords); WordsDictionary dic = new WordsDictionary(levDist, filler); List<string> resWords = new List<string>() { "First", "Fifth" }; // act List<string> res = dic.GetClosestWords("Funci"); // assert Assert.IsTrue(Enumerable.SequenceEqual(resWords, res)); }
public void GetListOfClosestWordsCountTest() { // arrange MockLevenshteinDictionary levDist = new MockLevenshteinDictionary(); List<string> origWords = new List<string>() { "First", "Second", "Third", "Fourth", "Fifth", "Sixth" }; MockDictionaryFileFiller filler = new MockDictionaryFileFiller(origWords); WordsDictionary dic = new WordsDictionary(levDist, filler); // act List<string> res = dic.GetClosestWords("Seventh"); // assert Assert.AreEqual(origWords.Count, levDist.CalcLevenshteinDistanceEnters); }