Exemplo n.º 1
0
        public void MultipleTermsByPrefixTest()
        {
            var searchTerms = new[] { "DAR", "TOW" };
            var trie = new TrieCol();
            var output = searchTerms;

            trie.Add(searchTerms);
            var result = trie.GetAllSearchTerms();

            Assert.IsNotNull(result);
            Assert.AreEqual(output.Count(), output.Where(result.Contains).Count());
        }
Exemplo n.º 2
0
        public void SingleCharTest()
        {
            var searchTerms = new[] { "D" };
            var trie = new TrieCol();
            var output = searchTerms;

            trie.Add(searchTerms);
            var result = trie.GetAllSearchTerms();

            Assert.IsNotNull(result);
            Assert.AreEqual(output.Count(), output.Where(result.Contains).Count());
        }