public void SendPasswordRecoveryLink() { unitOfWork.Data = Utils.CreateAdminAndUser(); var result = controller.SendPasswordRecoveryLink("xxx"); Utils.AssertRequestMessageAndStatus(result, HttpStatusCode.InternalServerError); HttpContext.Current = Utils.GetDummyHttpContext(); result = controller.SendPasswordRecoveryLink(unitOfWork.Data.Users.FirstOrDefault(u => !string.IsNullOrEmpty(u.email))?.email); Assert.IsNotInstanceOfType(result, typeof(HttpResponseMessage)); Assert.IsFalse(string.IsNullOrEmpty(mailHelper.Data.Subject)); }