Exemplo n.º 1
0
  @Test
  public void testLogin() throws IllegalActionException, ServiceException {

    // User clicks login
    presenter.onLoginClick();

    // Login dialog appears
    verify(loginDialog).showCentered();

    // User fills login form and he submits it
    presenter.onLogin(testUserProvider.getUser().name(), testUserProvider.getPassword());

    // User is logged
    verify(userBarView).setUsername(testUserProvider.getUser().name());
  }
Exemplo n.º 2
0
  @Before
  public void setup() {

    MockitoAnnotations.initMocks(this);

    ModuleAnnotations.init(this);

    testUserProvider.createTestUser();
  }
Exemplo n.º 3
0
  @Test
  public void testSignupFail() throws IllegalActionException, ServiceException {

    String username = testUserProvider.getUser().name();

    // User clicks sign-up
    presenter.onRegister();

    // Register dialog appears
    verify(registerDialog).showCentered();

    // User fills register form and he submits it
    presenter.onRegister(username, "newPassword", "*****@*****.**");

    // Alert dialog is shown
    verify(alertDialog).center(Mockito.any(Error.class));
  }