Пример #1
0
        public void StripSpecifiedWrapperException()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

            WrapperException wrapper = new WrapperException(_exception);

            List <Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper).ToList();

            Assert.AreEqual(1, exceptions.Count);
            Assert.IsTrue(exceptions.Contains(_exception));
        }
Пример #2
0
        public void StripMultipleWrapperExceptions()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

            WrapperException          wrapper  = new WrapperException(_exception);
            TargetInvocationException wrapper2 = new TargetInvocationException(wrapper);

            List <Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper2).ToList();

            Assert.AreEqual(1, exceptions.Count);
            Assert.IsTrue(exceptions.Contains(_exception));
        }
Пример #3
0
        public void StripSpecifiedWrapperException()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

              WrapperException wrapper = new WrapperException(_exception);

              List<Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper).ToList();
              Assert.AreEqual(1, exceptions.Count);
              Assert.IsTrue(exceptions.Contains(_exception));
        }
Пример #4
0
        public void StripMultipleWrapperExceptions()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

              WrapperException wrapper = new WrapperException(_exception);
              TargetInvocationException wrapper2 = new TargetInvocationException(wrapper);

              List<Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper2).ToList();
              Assert.AreEqual(1, exceptions.Count);
              Assert.IsTrue(exceptions.Contains(_exception));
        }