public void GetPartialTermWithMultipleBranchesTest() { var searchTerms = new[] { "DARTFORD", "DARTMOUTH" }; var trie = new TrieCol(searchTerms); var output = searchTerms; var result = trie.Find("DAR"); Assert.IsNotNull(result); Assert.AreEqual(output.Count(), output.Where(result.Contains).Count()); }
public void GetTermsWithMultipleBranchesTest() { var searchTerms = new[] { "LIVERPOOL", "LIVERPOOL LIME STREET" }; var trie = new TrieCol(searchTerms); var output = searchTerms; var result = trie.Find("L"); Assert.IsNotNull(result); Assert.AreEqual(output.Count(), output.Where(result.Contains).Count()); }
public void GetPartialTermTest() { var searchTerms = new[] { "DAR" }; var trie = new TrieCol(searchTerms); var output = searchTerms; var result = trie.Find("DA"); Assert.IsNotNull(result); Assert.AreEqual(output.Count(), output.Where(result.Contains).Count()); }