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); }
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)); }