Beispiel #1
0
        public void TestContains()
        {
            var trie = new PrefixTrie(
                new[] { "one", "two", "three" }
                );

            foreach (var contained in new[] { "one", "two", "three" })
            {
                trie.Contains(contained).Should().BeTrue();
            }

            foreach (var notContained in new[] { "four", "threeAndSome" })
            {
                trie.Contains(notContained).Should().BeFalse();
            }
        }
Beispiel #2
0
        public void TestContains_DoesNotContainPrefixes()
        {
            var trie = new PrefixTrie(
                new[] { "one", "two", "three" }
                );

            foreach (var notContained in new[] { "", "t", "tw" })
            {
                trie.Contains(notContained).Should().BeFalse();
            }
        }