コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }