public void StartLoginLocalReturnUrl() { var controller = MockHelpers.CreateAccountController(); var result = controller.Login(MockHelpers.LocalUri) as ViewResult; Assert.NotNull(result); Assert.Equal(MockHelpers.LocalUri, result.ViewBag.ReturnUrl); }
public void StartLoginEmptyReturnUrl() { var controller = MockHelpers.CreateAccountController(); var result = controller.Login(null) as ViewResult; Assert.NotNull(result); Assert.Null(result.ViewBag.ReturnUrl); }
public void ConfirmForgotPassword() { var controller = MockHelpers.CreateAccountController(); var result = controller.ForgotPasswordConfirmation(); var view = result as ViewResult; Assert.NotNull(view); }
private void MidResetPassword(string code, ResultType expectedResult = ResultType.Success) { var controller = MockHelpers.CreateAccountController(); var result = controller.ResetPassword(code); var view = result as ViewResult; switch (expectedResult) { case ResultType.ModelError: Assert.NotNull(view); Assert.Equal("Error", view.ViewName); break; case ResultType.Success: Assert.NotNull(view); Assert.NotEqual("Error", view.ViewName); break; } }