Beispiel #1
0
        private void Validate <T>(int size, BinaryTreeNode <int> expected)
            where T : IEquatable <T>
        {
            var result = Question_4_2.CreateMinimalBinaryTree(Enumerable.Range(0, size).ToArray());

            TreeHelpers.AssertBinaryTreesEqual <int>(expected, result);
        }
Beispiel #2
0
 public void Question_4_2_InvalidCases()
 {
     TestHelpers.AssertExceptionThrown(() => Question_4_2.CreateMinimalBinaryTree(null), typeof(ArgumentNullException));
     TestHelpers.AssertExceptionThrown(() => Question_4_2.CreateMinimalBinaryTree(new int[0]), typeof(ArgumentOutOfRangeException));
 }