コード例 #1
0
        public void FindNode4()
        {
            var classTree = new PrintTreeClass.ClassTree("Class1.Class2");

            classTree.AddToTree("Class1.Class2.Class3");
            classTree.AddToTree("Class1.Class22.Class3");
            classTree.AddToTree("Class1.Class22.Class33");
            classTree.AddToTree("Class1.Class21.Class3");

            var node = classTree.FindNode("Class1.Class2.Varnsdsd");

            Assert.AreEqual("Class2", node.Name);
            node = classTree.FindNode("Class1.Class2.Class3.Varnasd");
            Assert.AreEqual("Class3", node.Name);
            node = classTree.FindNode("Class1.Varname");
            Assert.AreEqual("Class1", node.Name);
            node = classTree.FindNode("Class1.Class22"); //Strange case but seems to exist
            Assert.AreEqual("Class1", node.Name);
        }
コード例 #2
0
        public void FindNode2()
        {
            var classTree = new PrintTreeClass.ClassTree("Class1.Class2");

            classTree.AddToTree("Class1.Class2.Class3");
            var node = classTree.FindNode("Class1.Class2.Varnsdsd");

            Assert.AreEqual("Class2", node.Name);
            node = classTree.FindNode("Class1.Class2.Class3.Varnasd");
            Assert.AreEqual("Class3", node.Name);
        }