Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void StartLoginEmptyReturnUrl()
        {
            var controller = MockHelpers.CreateAccountController();
            var result     = controller.Login(null) as ViewResult;

            Assert.NotNull(result);
            Assert.Null(result.ViewBag.ReturnUrl);
        }
Exemplo n.º 3
0
        public void ConfirmForgotPassword()
        {
            var controller = MockHelpers.CreateAccountController();
            var result     = controller.ForgotPasswordConfirmation();

            var view = result as ViewResult;

            Assert.NotNull(view);
        }
Exemplo n.º 4
0
        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;
            }
        }