public async void HttpPost_ResetPasswordRequest_EmailNotInDatabase_ReturnsError() { var model = new ResetPasswordRequestViewModel { Email = "[email protected]" }; A.CallTo(() => apiClient.User.ResetPasswordRequestAsync(A<string>._)).Returns(false); var controller = AccountController(); var result = await controller.ResetPasswordRequest(model); Assert.IsType<ViewResult>(result); Assert.Equal(model, ((ViewResult)(result)).Model); Assert.False(controller.ModelState.IsValid); }
public async void HttpPost_ResetPasswordRequest_EmailNotInDatabase_ReturnsResetPasswordInstructionView() { var model = new ResetPasswordRequestViewModel { Email = "[email protected]" }; A.CallTo(() => apiClient.User.ResetPasswordRequestAsync(A<string>._)).Returns(true); var controller = AccountController(); var result = await controller.ResetPasswordRequest(model); var viewResult = (ViewResult)result; Assert.Equal("ResetPasswordInstruction", viewResult.ViewName); Assert.Equal(model.Email, viewResult.ViewBag.Email); }