public void Constructor9_ValueAsElementArgument_ShouldSetElementProperty()
        {
            var expectations = Expectations.GetCompositionElements();

            foreach (var e in expectations)
            {
                var exception = new ComposablePartException("Message", (ICompositionElement)e, new Exception());

                Assert.AreSame(e, exception.Element);
            }
        }
        public void Constructor6_NullAsMessageArgument_ShouldSetMessagePropertyToDefault()
        {
            var exception = new ComposablePartException((string)null);

            ExceptionAssert.HasDefaultMessage(exception);
        }
        public void Constructor7_ShouldSetElementPropertyToNull()
        {
            var exception = new ComposablePartException("Message", new Exception());

            Assert.IsNull(exception.Element);
        }
        public void Constructor9_NullAsElementArgument_ShouldSetElementPropertyToNull()
        {
            var exception = new ComposablePartException("Message", (ICompositionElement)null, new Exception());

            Assert.IsNull(exception.Element);
        }
        public void Constructor7_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull()
        {
            var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (Exception)null);

            Assert.IsNull(exception.InnerException);
        }
        public void Constructor9_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty()
        {
            var expectations = Expectations.GetInnerExceptions();

            foreach (var e in expectations)
            {
                var exception = new ComposablePartException("Message", ElementFactory.Create(), e);

                Assert.AreSame(e, exception.InnerException);
            }
        }
        public void Constructor1_ShouldSetMessagePropertyToDefault()
        {
            var exception = new ComposablePartException();

            ExceptionAssert.HasDefaultMessage(exception);
        }
Esempio n. 8
0
        public ComposablePartExceptionDebuggerProxy(ComposablePartException exception)
        {
            Requires.NotNull(exception, nameof(exception));

            _exception = exception;
        }
        public void Constructor7_NullAsMessageArgument_ShouldSetMessagePropertyToDefault()
        {
            var exception = new ComposablePartException(CompositionErrorId.Unknown, (string)null, new Exception());

            ExceptionAssert.HasDefaultMessage(exception);
        }
        public ComposablePartExceptionDebuggerProxy(ComposablePartException exception)
        {
            Requires.NotNull(exception, "exception");

            this._exception = exception;
        }
        public void Constructor8_NullAsElementArgument_ShouldSetElementPropertyToNull()
        {
            var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (ICompositionElement)null);

            Assert.IsNull(exception.Element);
        }
        public void Constructor7_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty()
        {
            var expectations = Expectations.GetInnerExceptions();

            foreach (var e in expectations)
            {
                var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", e);

                Assert.AreSame(e, exception.InnerException);
            }
        }
        public void Constructor8_ShouldSetInnerExceptionPropertyToNull()
        {
            var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", ElementFactory.Create());

            Assert.IsNull(exception.InnerException);
        }
        public void Constructor9_NullAsMessageArgument_ShouldSetMessagePropertyToDefault()
        {
            var exception = new ComposablePartException((string)null, ElementFactory.Create(), new Exception());

            ExceptionAssert.HasDefaultMessage(exception);
        }
        public void Constructor6_ShouldSetInnerExceptionPropertyToNull()
        {
            var exception = new ComposablePartException("Message");

            Assert.IsNull(exception.InnerException);
        }
        public void Constructor2_ValueAsMessageArgument_ShouldSetMessageProperty()
        {
            var expectations = Expectations.GetExceptionMessages();

            foreach (var e in expectations)
            {
                var exception = new ComposablePartException(e);

                Assert.AreEqual(e, exception.Message);
            }
        }
        public void Constructor9_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull()
        {
            var exception = new ComposablePartException("Message", ElementFactory.Create(), (Exception)null);

            Assert.IsNull(exception.InnerException);
        }
        public ComposablePartExceptionDebuggerProxy(ComposablePartException exception)
        {
            Requires.NotNull(exception, "exception");

            this._exception = exception;
        }
        public void Constructor9_ValueAsMessageArgument_ShouldSetMessageProperty()
        {
            var expectations = Expectations.GetExceptionMessages();

            foreach (var e in expectations)
            {
                var exception = new ComposablePartException(CompositionErrorId.Unknown, e, ElementFactory.Create(), new Exception());

                Assert.AreEqual(e, exception.Message);
            }
        }