Exemple #1
0
        public void FindByTypeTwoTopSearchFromOneLowerChildTest()
        {
            TempNode node = new TempNode("Child");

            ApplicationNode.AddNode(node);
            TempNode node2 = new TempNode("Child");
            TempNode node3 = new TempNode("Child");

            ApplicationNode.AddNode(node2);
            node2.AddNode(node3);
            node3.AddNode(new AnotherNode("Child"));
            node3.AddNode(new AnotherNode("Another"));
            IList <ConfigurationNode> foundNodes = Hierarchy.FindNodesByType(typeof(AnotherNode));

            Assert.AreEqual(2, foundNodes.Count);
        }
        public void CanDetermineIfHierarchyContainsANodeType()
        {
            TempNode node = new TempNode("Child");
            ApplicationNode.AddNode(node);
            node.AddNode(new TestNode("Child2"));
            node.Nodes[0].AddNode(new TempNode("Child"));

            Assert.IsTrue(Hierarchy.ContainsNodeType(typeof(TempNode)));
        }
Exemple #3
0
        public void CanDetermineIfAParentInTheHierarchyContainsANodeType()
        {
            TempNode node = new TempNode("Child");

            ApplicationNode.AddNode(node);
            node.AddNode(new TestNode("Child2"));
            node.Nodes[0].AddNode(new TempNode("Child"));

            Assert.IsTrue(Hierarchy.ContainsNodeType(node, typeof(TempNode)));
        }
Exemple #4
0
        public void FindGrandChildNodeByType()
        {
            TempNode node = new TempNode("Child");

            ApplicationNode.AddNode(node);
            node.AddNode(new TempNode("Child"));
            IList <ConfigurationNode> foundNodes = Hierarchy.FindNodesByType(typeof(TempNode));

            Assert.AreEqual(2, foundNodes.Count);
        }
Exemple #5
0
        public void FindByTypeGrandGrandChildTest()
        {
            TempNode node = new TempNode("Child");

            ApplicationNode.AddNode(node);
            TempNode deepNode = new TempNode("Child");

            node.AddNode(deepNode);
            deepNode.AddNode(new AnotherNode("Another"));
            IList <ConfigurationNode> foundNodes = Hierarchy.FindNodesByType(typeof(AnotherNode));

            Assert.AreEqual(1, foundNodes.Count);
        }
        public void FindGrandChildNodeByType()
        {
            TempNode node = new TempNode("Child");
            ApplicationNode.AddNode(node);
            node.AddNode(new TempNode("Child"));
            IList<ConfigurationNode> foundNodes = Hierarchy.FindNodesByType(typeof(TempNode));

            Assert.AreEqual(2, foundNodes.Count);
        }
        public void FindByTypeTwoTopSearchFromOneLowerChildTest()
        {
            TempNode node = new TempNode("Child");
            ApplicationNode.AddNode(node);
            TempNode node2 = new TempNode("Child");
            TempNode node3 = new TempNode("Child");
            ApplicationNode.AddNode(node2);
            node2.AddNode(node3);
            node3.AddNode(new AnotherNode("Child"));
            node3.AddNode(new AnotherNode("Another"));
            IList<ConfigurationNode> foundNodes = Hierarchy.FindNodesByType(typeof(AnotherNode));

            Assert.AreEqual(2, foundNodes.Count);
        }
        public void FindByTypeGrandGrandChildTest()
        {
            TempNode node = new TempNode("Child");
            ApplicationNode.AddNode(node);
            TempNode deepNode = new TempNode("Child");
            node.AddNode(deepNode);
            deepNode.AddNode(new AnotherNode("Another"));
            IList<ConfigurationNode> foundNodes = Hierarchy.FindNodesByType(typeof(AnotherNode));

            Assert.AreEqual(1, foundNodes.Count);
        }