public void oneArray() { int[] inputArray = new int[] { 5 }; MBT mbt = new MBT(); TreeNode node = new TreeNode(); TreeNode expectedNode = new TreeNode(5); node = mbt.construct(inputArray, 0, 1); Assert.AreEqual(expectedNode.val, node.val); }
public void twoArray() { int[] inputArray = new int[] { 3, 5 }; MBT mbt = new MBT(); TreeNode node = new TreeNode(); TreeNode expectedNode = new TreeNode(5); expectedNode.left = new TreeNode(3); node = mbt.construct(inputArray, 0, 2); Assert.AreEqual(expectedNode.val, node.val); Assert.AreEqual(expectedNode.left.val, node.left.val); }