Exemplo n.º 1
0
        public void TestGetDescendantInfo()
        {
            DomNodeType grandchildType = new DomNodeType("grandchild");
            ChildInfo   grandChildInfo = new ChildInfo("grandChild", grandchildType);
            DomNodeType childType      = new DomNodeType("child");

            childType.Define(grandChildInfo);

            Assert.Null(childType.GetDescendantInfo(string.Empty));
            Assert.Null(childType.GetDescendantInfo("foo"));
            Assert.AreSame(childType.GetDescendantInfo("grandChild"), grandChildInfo);

            ChildInfo   childInfo  = new ChildInfo("child", childType);
            DomNodeType parentType = new DomNodeType("parent");

            parentType.Define(childInfo);

            Assert.AreSame(parentType.GetDescendantInfo("child"), childInfo);
            Assert.AreSame(parentType.GetDescendantInfo("child:grandChild"), grandChildInfo);
        }
Exemplo n.º 2
0
        public void TestGetDescendantInfo()
        {
            DomNodeType grandchildType = new DomNodeType("grandchild");
            ChildInfo grandChildInfo = new ChildInfo("grandChild", grandchildType);
            DomNodeType childType = new DomNodeType("child");
            childType.Define(grandChildInfo);

            Assert.Null(childType.GetDescendantInfo(string.Empty));
            Assert.Null(childType.GetDescendantInfo("foo"));
            Assert.AreSame(childType.GetDescendantInfo("grandChild"), grandChildInfo);

            ChildInfo childInfo = new ChildInfo("child", childType);
            DomNodeType parentType = new DomNodeType("parent");
            parentType.Define(childInfo);

            Assert.AreSame(parentType.GetDescendantInfo("child"), childInfo);
            Assert.AreSame(parentType.GetDescendantInfo("child:grandChild"), grandChildInfo);
        }