public void ResetPassword_Post_GenerateNewPasswordAndReturnsRedirectOnSuccess()
 {
     //Non posso verificare l'invio della mail da qui
       //mockUsersService.Setup(x => x.SendResetPasswordToEmail(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
       AccountController controller = GetAccountController();
       ResetPasswordModel model = new ResetPasswordModel() { UserName = "******" };
       ActionResult result = controller.ResetPassword(model);
       Assert.IsInstanceOf(typeof(RedirectToRouteResult), result);
       RedirectToRouteResult redirectResult = (RedirectToRouteResult)result;
       Assert.AreEqual("ResetPasswordSuccess", redirectResult.RouteValues["action"]);
 }
 public ActionResult ResetPassword(ResetPasswordModel model)
 {
     if (ModelState.IsValid)
       {
     if (MembershipService.ResetPassword(model.UserName, model.NewPassword))
       return RedirectToAction("ResetPasswordSuccess");
     else
       ModelState.AddModelError("", Resources.WebSite.Controllers.UserNotFound);
       }
       return View(model);
 }
 public void ResetPassword_Post_ErrorOnUserNameNotFound()
 {
     AccountController controller = GetAccountController();
       ResetPasswordModel model = new ResetPasswordModel() { UserName = "******" };
       ActionResult result = controller.ResetPassword(model);
       Assert.IsInstanceOf(typeof(ViewResult), result);
       ViewResult viewResult = (ViewResult)result;
       Assert.AreEqual(model, viewResult.ViewData.Model);
       Assert.AreEqual(1, controller.ModelState.Values.Count);
 }