public void FailWhenWrongExceptionIsThrown() { var emptyList = new List <object>(); AssertAll.ThrowsException <NullReferenceException>(() => emptyList.Single()); Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute()); }
public void PassWhenExceptionOfCorrectTypeIsThrown() { var emptyList = new List <object>(); AssertAll.ThrowsException <InvalidOperationException>(() => emptyList.Single()); AssertAll.Execute(); }
public void FailWhenNoExceptionIsThrown() { var list = new List <object> { new object() }; AssertAll.ThrowsException <InvalidOperationException>(() => list.Single()); Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute()); }