Created
October 19, 2010 14:54
-
-
Save amaltson/634324 to your computer and use it in GitHub Desktop.
GWT UI unit test, fails
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 LoginViewTest { | |
@Mock | |
private TextBox username; | |
@Mock | |
private TextBox password; | |
private LoginView loginView; | |
@BeforeMethod | |
public void initBefore() { | |
MockitoAnnotations.initMocks(this); | |
loginView = new LoginView(username, password); | |
} | |
@Test | |
public void notValidUsernamePassword() { | |
when(username.getText()).thenReturn("p"); | |
when(password.getText()).thenReturn("pass"); | |
Assert.assertFalse(loginView.validUsernameAndPassword()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment