public void InsertTest() { var tree = new BinarySearchTree <int>(); tree.Insert(2); tree.Insert(1); tree.Insert(3); Assert.That(tree.ToArrayInOrder(), Is.EqualTo(new int[] { 1, 2, 3 })); }
public void ToArrayEmptyTest() { var tree = new BinarySearchTree <int>(); Assert.That(tree.ToArrayInOrder(), Is.EqualTo(new int[] { })); }
public void ToArrayInOrderTest() { var tree = new BinarySearchTree <int>(new int[] { 1, 2, 3, 4, 5 }); Assert.That(tree.ToArrayInOrder(), Is.EqualTo(new int[] { 1, 2, 3, 4, 5 })); }