Пример #1
0
        public void FailWhenInnerExceptionIsNotCorrectType()
        {
            AssertAll.ThrowsExceptionWithInnerException <ArgumentException>(() =>
                                                                            ThrowExceptionWithInnerInvalidOperationException(true));

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }
Пример #2
0
        public void PassWhenInnerExceptionIsOfCorrectType()
        {
            AssertAll.ThrowsExceptionWithInnerException <InvalidOperationException>(() =>
                                                                                    ThrowExceptionWithInnerInvalidOperationException(true));

            AssertAll.Execute();
        }
Пример #3
0
        public void FailWhenNoExceptionIsThrown()
        {
            var list = new List <object>()
            {
                new object()
            };

            AssertAll.ThrowsExceptionWithInnerException <InvalidOperationException>(() =>
                                                                                    ThrowExceptionWithInnerInvalidOperationException(false));

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }