Last active
August 29, 2015 14:04
-
-
Save paytonrules/d5eef8e986f5fd28598a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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