예제 #1
0
        public void FailWhenWrongExceptionIsThrown()
        {
            var emptyList = new List <object>();

            AssertAll.ThrowsException <NullReferenceException>(() => emptyList.Single());

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }
예제 #2
0
        public void PassWhenExceptionOfCorrectTypeIsThrown()
        {
            var emptyList = new List <object>();

            AssertAll.ThrowsException <InvalidOperationException>(() => emptyList.Single());

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

            AssertAll.ThrowsException <InvalidOperationException>(() => list.Single());

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