Exemple #1
0
        public void TestNotDirectType()
        {
            var exception = new TestException();

            Assert.IsFalse(exception.IsOrContainsExceptionType(typeof(InvalidOperationException)));
            Assert.IsFalse(exception.IsOrContainsExceptionType <InvalidOperationException>());

            Assert.IsNull(exception.GetPossibleInnerException <InvalidOperationException>());
        }
Exemple #2
0
        public void TestDirectType()
        {
            var exception = new TestException();

            Assert.IsTrue(exception.IsOrContainsExceptionType(typeof(TestException)));
            Assert.IsTrue(exception.IsOrContainsExceptionType <TestException>());

            Assert.AreEqual(exception.GetPossibleInnerException <TestException>(), exception);
        }