public void ThrowIfErrorFailTest() { //arrange var testError = new Exception(); _task.Reject(testError); //act Exception realError = null; try { _task.ThrowIfError(); } catch (Exception e) { realError = e; } //assert Assert.AreEqual(testError, realError); }