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

            Assert.NotNull(result);
            Assert.Null(result.ViewBag.ReturnUrl);
        }
示例#3
0
        public void ConfirmForgotPassword()
        {
            var controller = MockHelpers.CreateAccountController();
            var result     = controller.ForgotPasswordConfirmation();

            var view = result as ViewResult;

            Assert.NotNull(view);
        }
示例#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;
            }
        }