Skip to content

Instantly share code, notes, and snippets.

@paytonrules
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save paytonrules/d5eef8e986f5fd28598a to your computer and use it in GitHub Desktop.

Select an option

Save paytonrules/d5eef8e986f5fd28598a to your computer and use it in GitHub Desktop.
public class LoginDialogDriver
{
private String userName;
private String password;
private String message;
private int loginAttempts;
public LoginDialogDriver(String userName, String password)
{
this.userName = userName;
this.password = password;
}
public bool loginWithUsernameAndPassword(String userName, String password)
{
loginAttempts++;
bool result = this.userName.Equals(userName) &&
this.password.Equals(password);
if (result)
message = String.Format("{0} logged in.", this.userName);
else
message = String.Format("{0} not logged in.", this.userName);
return result;
}
public String loginMessage()
{
return message;
}
public int numberOfLoginAttempts()
{
return loginAttempts;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment