public void TestNotDirectType() { var exception = new TestException(); Assert.IsFalse(exception.IsOrContainsExceptionType(typeof(InvalidOperationException))); Assert.IsFalse(exception.IsOrContainsExceptionType <InvalidOperationException>()); Assert.IsNull(exception.GetPossibleInnerException <InvalidOperationException>()); }
public void TestDirectType() { var exception = new TestException(); Assert.IsTrue(exception.IsOrContainsExceptionType(typeof(TestException))); Assert.IsTrue(exception.IsOrContainsExceptionType <TestException>()); Assert.AreEqual(exception.GetPossibleInnerException <TestException>(), exception); }