Exemplo n.º 1
0
        public void Q4TreeDiameterTest()
        {
            //Assert.Inconclusive();
            Q4TreeDiameter td = new Q4TreeDiameter(10, 0);

            Assert.AreEqual(td.TreeHeight(), 4);
        }
Exemplo n.º 2
0
        public void Q4TreeDiameterTest()
        {
            Random         rnd      = new Random();
            int            TestSize = rnd.Next(0, 1000);
            Q4TreeDiameter td       = new Q4TreeDiameter(TestSize);

            Assert.AreEqual(TestSize, td.Nodes.Count());
        }
Exemplo n.º 3
0
        public void TreeHeightTest()
        {
            Q4TreeDiameter td  = new Q4TreeDiameter(10, 0);
            Q4TreeDiameter td2 = new Q4TreeDiameter(15, 0);

            Assert.AreEqual(td.TreeHeight(), 4);
            Assert.AreEqual(td2.TreeHeight(), 4);
        }
        public void TreeHeightTest()
        {
            //    Q4TreeDiameter td = new Q4TreeDiameter(10, 0);
            //    Assert.AreEqual(4, td.TreeHeight());

            Q4TreeDiameter td2 = new Q4TreeDiameter(15, 2);

            Assert.AreEqual(4, td2.TreeHeight());
        }
Exemplo n.º 5
0
        public void TreeHeightFromNodeTest()
        {
            Assert.Inconclusive();
            //Q4TreeDiameter td = new Q4TreeDiameter(10, 0);
            Q4TreeDiameter td2 = new Q4TreeDiameter(15, 0);

            //Assert.AreEqual(td.TreeHeightFromNode(5), 4);
            Assert.AreEqual(td2.TreeHeightFromNode(5), 6);
        }
        public void TreeDiameterN2Test()
        {
            //Q4TreeDiameter td = new Q4TreeDiameter(10, 0);
            //Assert.AreEqual(6, td.TreeDiameterN2());

            Q4TreeDiameter td2 = new Q4TreeDiameter(15, 2);

            Assert.AreEqual(7, td2.TreeDiameterN2());
            //Assert.Inconclusive();
        }
        public void TreeHeightFromNodeTest()
        {
            Q4TreeDiameter td = new Q4TreeDiameter(10, 0);

            //Assert.AreEqual(6, td.TreeHeightFromNode(9));
            //Assert.AreEqual(6, td.TreeHeightFromNode(2));
            //Assert.AreEqual(5, td.TreeHeightFromNode(6));
            Assert.AreEqual(6, td.TreeHeightFromNode(5));

            Q4TreeDiameter td2 = new Q4TreeDiameter(15, 2);

            Assert.AreEqual(7, td2.TreeHeightFromNode(9));
            Assert.AreEqual(5, td2.TreeHeightFromNode(13));
            //Assert.Inconclusive();
        }
Exemplo n.º 8
0
        public void TreeDiameterN2Test()
        {
            int TestSize = 11;
            var TestTree = new List <int> [TestSize];

            TestTree[0]  = new int[] { 1, 2, 3, 4 }.ToList();
            TestTree[1]  = new int[] { 10 }.ToList();
            TestTree[2]  = new int[] { 5 }.ToList();
            TestTree[3]  = new int[] { 9 }.ToList();
            TestTree[4]  = new List <int>();
            TestTree[5]  = new int[] { 6, 7, 8 }.ToList();
            TestTree[6]  = new List <int>();
            TestTree[7]  = new List <int>();
            TestTree[8]  = new List <int>();
            TestTree[9]  = new List <int>();
            TestTree[10] = new List <int>();

            int ExpectedDiameter = 5;

            Q4TreeDiameter Test = new Q4TreeDiameter(10, TestTree);

            Assert.AreEqual(ExpectedDiameter, Test.TreeDiameterN2());
        }
 public void Q4TreeDiameterTest()
 {
     //Assert.Inconclusive();
     Q4TreeDiameter td  = new Q4TreeDiameter(10, 0);
     Q4TreeDiameter td2 = new Q4TreeDiameter(15, 2);
 }