Example #1
0
        public void GetDescendantsDepthFirst()
        {
            DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              DummySceneNode nodeD = new DummySceneNode();
              nodeA.Children.Add(nodeB);
              nodeA.Children.Add(nodeC);
              nodeB.Children.Add(nodeD);

              var descendants = nodeA.GetDescendants().ToArray();
              Assert.AreEqual(3, descendants.Length);
              Assert.AreSame(nodeB, descendants[0]);
              Assert.AreSame(nodeD, descendants[1]);
              Assert.AreSame(nodeC, descendants[2]);
        }
Example #2
0
        public void GetDescendantsBreadthFirst()
        {
            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();
            DummySceneNode nodeD = new DummySceneNode();

            nodeA.Children.Add(nodeB);
            nodeA.Children.Add(nodeC);
            nodeB.Children.Add(nodeD);

            var descendants = nodeA.GetDescendants(false).ToArray();

            Assert.AreEqual(3, descendants.Length);
            Assert.AreSame(nodeB, descendants[0]);
            Assert.AreSame(nodeC, descendants[1]);
            Assert.AreSame(nodeD, descendants[2]);
        }
Example #3
0
 public void GetDescendantsOfLeaf()
 {
     DummySceneNode nodeA = new DummySceneNode();
       Assert.AreEqual(0, nodeA.GetDescendants().Count());
 }
Example #4
0
        public void GetDescendantsOfLeaf()
        {
            DummySceneNode nodeA = new DummySceneNode();

            Assert.AreEqual(0, nodeA.GetDescendants().Count());
        }