Ejemplo n.º 1
0
        private static void Validate <T>(BinaryTreeNode <T> expected, BinaryTreeNode <T> a, BinaryTreeNode <T> b)
            where T : IEquatable <T>
        {
            var result = Question_4_8.FindCommonAncestor(a, b);

            Assert.AreEqual(expected.Data, result.Data);
        }
Ejemplo n.º 2
0
 public void Question_4_8_InvalidCases()
 {
     TestHelpers.AssertExceptionThrown(() => Question_4_8.FindCommonAncestor(null, new BinaryTreeNode <int>(1)), typeof(ArgumentNullException));
     TestHelpers.AssertExceptionThrown(() => Question_4_8.FindCommonAncestor(new BinaryTreeNode <int>(1), null), typeof(ArgumentNullException));
 }