public void Should_Validate_UserSupplied_EmailAddress_Against_Registered_Emails() { // Arrange repository.GetCredentials(Arg.Any <string>()).Returns((ICredentials)null); // Act accountBusiness.ForgotPassword("*****@*****.**"); }
public HttpResponseMessage ForgotPassword([FromBody] AccountDetailsModel details) { if ((details.Email ?? "").Length == 0) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.BadRequest)); } IUser user; try { user = accountBusiness.ForgotPassword(details.Email); } catch (UnrecognizedEmailAddressException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, user); response.Headers.Location = new Uri(Request.RequestUri, "/api/acount/" + user.Id); return(response); }