コード例 #1
0
        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));
        }
コード例 #2
0
 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));
 }