Exemplo n.º 1
0
 public void Can_Get_Array_From_Many()
 {
     int[] array = { 9, 5, 1, 14, 6 };
     var tree = new BinaryTree();
     tree.Init(array);
     int[] expected = { 1, 5, 6, 9, 14 };
     var actual = tree.ToArray();
     CollectionAssert.AreEqual(expected, actual);
 }
Exemplo n.º 2
0
 public void Can_Get_Array_From_1()
 {
     var tree = new BinaryTree();
     tree.Add(7);
     int[] expected = { 7 };
     var actual = tree.ToArray();
     CollectionAssert.AreEqual(expected, actual);
 }
Exemplo n.º 3
0
 public void Can_Get_Array_From_2()
 {
     int[] array = { 9, 5 };
     var tree = new BinaryTree();
     tree.Init(array);
     int[] expected = { 5, 9 };
     var actual = tree.ToArray();
     CollectionAssert.AreEqual(expected, actual);
 }
Exemplo n.º 4
0
 public void Can_Get_Array_From_0()
 {
     var tree = new BinaryTree();
     Assert.Throws<ArgumentNullException>(() => tree.ToArray());
 }