public void TravInTest()
        {
            BinTree<int> tree = new BinTree<int>(new BinNode<int>(10));
            tree.InsertAsLC(tree.Root(), 15);
            tree.InsertAsLC(tree.Root().LChild, 16);
            tree.InsertAsRC(tree.Root().LChild, 17);
            tree.InsertAsRC(tree.Root(), 20);
            tree.InsertAsLC(tree.Root().RChild, 21);

            int sum = 0;
            tree.TravIn(o => sum += o);
            Assert.IsTrue(sum == 99);
        }
        public void InsertAsLCTest()
        {
            BinTree<int> tree = new BinTree<int>(new BinNode<int>(10));
            tree.InsertAsLC(tree.Root(), 15);

            Assert.IsTrue(tree.Root().LChild.Data == 15);
        }
        public void SizeTest()
        {
            BinTree<int> tree = new BinTree<int>(new BinNode<int>(10));
            tree.InsertAsLC(tree.Root(), 15);
            Assert.IsTrue(tree.Size() == 2, "2");

            tree = new BinTree<int>(null);
            Assert.IsTrue(tree.Size() == 0);
        }
 public void HeightTest()
 {
     BinTree<int> tree = new BinTree<int>(new BinNode<int>(10));
     tree.InsertAsLC(tree.Root(), 15);
     Assert.IsTrue(tree.Height() == 1);
 }
 public void UpdateHeightTest()
 {
     BinTree<int> tree = new BinTree<int>(new BinNode<int>(10));
     tree.InsertAsLC(tree.Root(), 15);
     Assert.IsTrue(tree.Root().LChild.Height == 0, "lchild");
     tree.InsertAsLC(tree.Root().LChild, 16);
     tree.UpdateHeightAbove(tree.Root().LChild);
     Assert.IsTrue(tree.Root().LChild.Height == 1);
 }