public void InvalidInputTest() { var tree = new TreeNode <int>(0, null); TestHelpers.AssertExceptionThrown(() => { Question4_1.AreConnected(null, tree); }, typeof(ArgumentNullException)); TestHelpers.AssertExceptionThrown(() => { Question4_1.AreConnected(tree, null); }, typeof(ArgumentNullException)); }
private static void ValidateResult <T>(TreeNode <T> first, TreeNode <T> second, bool expectedValue) where T : IEquatable <T> { Assert.AreEqual(expectedValue, Question4_1.AreConnected(first, second)); }