Esempio n. 1
0
        public void FailWhenInnerExceptionIsNotCorrectType()
        {
            AssertAll.ThrowsExceptionWithInnerException <ArgumentException>(() =>
                                                                            ThrowExceptionWithInnerInvalidOperationException(true));

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }
Esempio n. 2
0
        public void PassWhenInnerExceptionIsOfCorrectType()
        {
            AssertAll.ThrowsExceptionWithInnerException <InvalidOperationException>(() =>
                                                                                    ThrowExceptionWithInnerInvalidOperationException(true));

            AssertAll.Execute();
        }
Esempio n. 3
0
        public void FailWhenNoExceptionIsThrown()
        {
            var list = new List <object>()
            {
                new object()
            };

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

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