コード例 #1
0
 @Test
 public void testPasswordChange() {
   when(view.getPassword()).thenReturn(PASSWORD);
   // emulates the presenter method executed from the UI.
   mainPanel.onPasswordChange();
   verify(view, times(1)).getPassword();
   // the handler should have been invoked and collected the expected value.
   assertEquals(PASSWORD, password);
 }
コード例 #2
0
 @Test
 public void testGetPassword() {
   when(view.getPassword()).thenReturn(PASSWORD);
   assertEquals(PASSWORD, mainPanel.getPassword());
 }