Example #1
0
 public LoginResult Login(LoginRequest loginRequest)
 {
     LongRunningOperationSimulator.Simulate();
     string password;
     return (_users.TryGetValue(loginRequest.UserName, out password) && password == loginRequest.Password)
         ? new LoginResult(true, string.Format("Welcome {0}!", loginRequest.UserName))
         : new LoginResult(false, "Invalid user name or password.");
 }
 private void Given_the_user_is_about_to_login()
 {
     _loginService = new LoginService();
     _loginService.AddUser(_validUserName, _validPassword);
     _loginRequest = new LoginRequest();
 }