Esempio n. 1
0
        public ActionResult Login(string documentName, string bookmark, LogOnModel loginModel)
        {
            SessionModel.Clear();
            if (_login.CanLogin(loginModel.UserName, loginModel.Password))
            {
                if(loginModel.RememberMe) SessionModel.Create(loginModel.UserName);
                return redirect(documentName, bookmark, loginModel.UserName);
            }

            loginModel.ErrorMessage = "Invalid Username or Password";
            return View("Login", loginModel);
        }
 public override void Given()
 {
     base.Given();
     logonModel = new LogOnModel();
     logonModel.UserName = "******";
     logonModel.Password = "******";
     LoginServices.Setup(d => d.CanLogin("InvalidUser", "InvalidPassword")).Returns(false);
 }
            public override void Given()
            {
                base.Given();
                logonModel = new LogOnModel();
                logonModel.UserName = "******";
                logonModel.Password = "******";
                logonModel.RememberMe = false;

                LoginServices.Setup(d => d.CanLogin("ValidUsername", "ValidPassword")).Returns(true);
                UrlGenerationService.Setup(d => d.GetUrlToRedirect("ValidUsername", "ValidDocumentName", "Bookmark", "ValidClient")).Returns("ValidUrl");
            }
 public override void Given()
 {
     base.Given();
     logonModel = new LogOnModel();
     logonModel.UserName = null;
     logonModel.Password = null;
     LoginServices.Setup(d => d.CanLogin(null, null)).Returns(false);
 }