Created
April 11, 2017 06:47
-
-
Save ecgreb/3431b90653b8ab2b1f02b461e43040f1 to your computer and use it in GitHub Desktop.
This file contains 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 LoginPresenterTest { | |
private TestLoginController loginController = new TestLoginController(); | |
private LoginPresenter loginPresenter = new LoginPresenter(new TestAccountValidator()); | |
@Before public void setUp() throws Exception { | |
loginPresenter.register(loginController); | |
} | |
@Test public void onLoginButtonClick_shouldShowSuccessOnValidInput() throws Exception { | |
loginPresenter.onLoginButtonClick("valid_username", "valid_password"); | |
assertThat(loginController.success).isTrue(); | |
} | |
@Test public void onLoginButtonClick_shouldShowErrorOnInvalidInput() throws Exception { | |
loginPresenter.onLoginButtonClick("invalid_username", "invalid_password"); | |
assertThat(loginController.error).isTrue(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment