Example #1
0
 public void SizeTest(int[] mas, int res)
 {
     BinaryTreeLink b = new BinaryTreeLink();
     b.Init(mas);
     int size = b.Size();
     Assert.AreEqual(res, size);
 }
Example #2
0
 public void ClearTest(int[] mas)
 {
     BinaryTreeLink b = new BinaryTreeLink();
     b.Init(mas);
     b.Clear();
     int size = b.Size();
     Assert.AreEqual(0, size);
 }
Example #3
0
 public void DelTest1(int[] mas, int res, int[] expMas)
 {
     BinaryTreeLink b = new BinaryTreeLink();
     b.Init(mas);
     b.Del(12);
     int size = b.Size();
     Assert.AreEqual(res, size);
     int[] masRes = b.ToArray();
     CollectionAssert.AreEqual(expMas, masRes);
 }
Example #4
0
 public void CountWidthTest(int[] mas, int res)
 {
     BinaryTreeLink b = new BinaryTreeLink();
     b.Init(mas);
     int nodes = b.Width();
     Assert.AreEqual(res, nodes);
 }
Example #5
0
 public void ToStringTest(int[] mas, int[] expMas)
 {
     BinaryTreeLink b = new BinaryTreeLink();
     b.Init(mas);
     string masRes = b.TreeToString();
     CollectionAssert.AreEqual(expMas.ToString(), masRes);
 }