コード例 #1
0
        public void PrefixTree_PartialMatch()
        {
            PrefixTree tree = new PrefixTree();
            tree.Insert("PATRIK");

            Assert.IsTrue(tree.IsPartialMatch("P"));
            Assert.IsTrue(tree.IsPartialMatch("PAT"));
            Assert.IsFalse(tree.IsPartialMatch("PAD"));
            Assert.IsFalse(tree.IsPartialMatch("T"));
            Assert.IsFalse(tree.IsPartialMatch(""));
        }
コード例 #2
0
        public void PrefixTree_PartialMatchWorksWithWrongCase()
        {
            PrefixTree tree = new PrefixTree();
            tree.Insert("PATRIK");

            Assert.IsTrue(tree.IsPartialMatch("p"));
            Assert.IsTrue(tree.IsPartialMatch("pat"));
            Assert.IsFalse(tree.IsPartialMatch("pad"));
            Assert.IsFalse(tree.IsPartialMatch("t"));
        }