public void SendMail_with_invalid_body_failed(string body) { //arrange //act var fakeRes = _service.SendMail(body, "Normal", "*****@*****.**"); var asyncFakeRes = _service.SendMailAsync(body, "Normal", "*****@*****.**").Result; //assert Assert.True(fakeRes.HasError); Assert.True(asyncFakeRes.HasError); }