Esempio n. 1
0
        public void SuffixTreeNodeResolver_ResolveTest2()
        {
            SuffixTreeNode         root     = new SuffixTreeNode(-1, false);
            SuffixTreeNodeResolver resolver = new SuffixTreeNodeResolver(root);

            SuffixTreeNode xxChild = new SuffixTreeNode(-1, false);
            SuffixTreeNode yyChild = new SuffixTreeNode(2, true);
            SuffixTreeNode zzChild = new SuffixTreeNode(3, true);

            root.AddChild("XX", xxChild);
            xxChild.AddChild("YY", yyChild);
            xxChild.AddChild("ZZ", zzChild);
            Assert.AreSame(xxChild, resolver.Resolve("X"));
            Assert.AreSame(xxChild, resolver.Resolve("XX"));
            Assert.AreSame(yyChild, resolver.Resolve("XXY"));
            Assert.AreSame(yyChild, resolver.Resolve("XXYY"));
            Assert.AreSame(zzChild, resolver.Resolve("XXZ"));
            Assert.AreSame(zzChild, resolver.Resolve("XXZZ"));
            Assert.IsNull(resolver.Resolve("XXYZ"));
        }