Exemple #1
0
 void DenyCircularDependency(BinaryThree value)
 {
     if (Contains(value))
     {
         HandleCircularDependency();
     }
 }
Exemple #2
0
 public void GetDepthEmptyTest()
 {
     BinaryThree tree = new BinaryThree();
     int emptyThreeDepth = tree.GetMaxDepth();
     int zero = 0;
     Assert.AreEqual(zero, emptyThreeDepth);
 }
Exemple #3
0
 bool Contains(BinaryThree test)
 {
     if (Equals(this, test) || Equals(Left, test) || Equals(Right, test))
     {
         return true;
     }
     if (Left.Contains(test) || Right.Contains(test))
     {
         return true;
     }
     return false;
 }
Exemple #4
0
 public void GetDepthTwoBranchesTest()
 {
     BinaryThree twoBranchesTree = new BinaryThree() { Left = new BinaryThree(), Right = new BinaryThree() };
     twoBranchesTree.GetMaxDepth();
 }
Exemple #5
0
 public void GetDepthOneBranchTest()
 {
     BinaryThree oneBranchTree = new BinaryThree() { Left = new BinaryThree() };
     int oneBranchThreeDepth = oneBranchTree.GetMaxDepth();
     Assert.AreEqual(1, oneBranchThreeDepth);
 }
Exemple #6
0
 public void CircularDependencyTest()
 {
     BinaryThree tree = new BinaryThree();
     tree.Left = new BinaryThree();
     tree.Right = tree.Left;
 }