Ejemplo n.º 1
0
 private void LogonWithUserNameAndPassword(string username, string password)
 {
     _logOnModel = new LogOnModel
     {
         UserName = username,
         Password = password,
     };
     Logon();
 }
Ejemplo n.º 2
0
 public ActionResult LogOn(LogOnModel model)
 {
     if (ModelState.IsValid)
     {
         if (UserAuthenticationService.SignIn(model.UserName, model.Password, model.RememberMe))
         {
             return RedirectToAction("Index", "Home");
         }
         ShowLoginError();
     }
     // If we got this far, something failed, redisplay form
     return View(model);
 }
Ejemplo n.º 3
0
        public AccountControllerTest()
        {
            _logOnModel = new LogOnModel
                              {
                                  UserName = _userName,
                                  Password = _password,
                                  RememberMe = false,
                              };

            _userAuthenticationService = new Mock<IUserAuthenticationService>();
            _sessionStateRepository = new Mock<ISessionStateRepository>();

            _accountControllerSUT = new AccountController(_userAuthenticationService.Object, _sessionStateRepository.Object);
        }
Ejemplo n.º 4
0
        public AccountControllerTest()
        {
            _logOnModel = new LogOnModel
                              {
                                  UserName = _userName,
                                  Password = _password,
                              };

            _userAuthenticationService = new Mock<IUserAuthenticationService>();
            _sessionStateRepository = new Mock<ISessionStateRepository>();
            _accountMapper = new Mock<IAccountMapper>();

            _accountControllerSUT = new AccountController(_userAuthenticationService.Object, _sessionStateRepository.Object, _accountMapper.Object);

            AccountMapper.ConfigAutoMapper();
        }
Ejemplo n.º 5
0
        public void LogonWithAccountTable(Table table)
        {
            _logOnModel = table.CreateInstance<LogOnModel>();

            Logon();
        }