コード例 #1
0
  @Override
  @Test
  public void checkAnExtendedWidget() {
    assertTrue(rottenTomatoes.getExtendeddMovieCount() >= 1);
    Movie movie = rottenTomatoes.getAnExtendedMovie(0);
    assertTrue(!StringUtils.isBlank(movie.title()));
    assertTrue(!StringUtils.isBlank(movie.score()));
    assertNotNull(movie.getPoster());
    movie.goToReview();

    rottenTomatoes.checkExtendedReview();
  }
コード例 #2
0
  @Test
  @Override
  public void checkACommonWidget() {
    assertTrue(rottenTomatoes.getSimpleMovieCount() >= 1);
    Movie movie = rottenTomatoes.getASimpleMovie(0);
    assertTrue(!StringUtils.isBlank(movie.title()));
    assertTrue(!StringUtils.isBlank(movie.score()));
    assertNotNull(movie.getPoster());
    movie.goToReview();

    rottenTomatoes.checkSimpleReview();
  }
コード例 #3
0
  @Override
  @Test
  public void checkTheLocatorOverridingOnAWidget() {
    try {
      assertTrue(rottenTomatoes.getFakedMovieCount() == 0);
    } catch (Exception e) {
      if (!NoSuchElementException.class.isAssignableFrom(e.getClass())) throw e;
    }

    rottenTomatoes.getASimpleMovie(0).goToReview();

    try {
      rottenTomatoes.checkFakeReview();
    } catch (Exception e) {
      if (NoSuchElementException.class.isAssignableFrom(e.getClass())) return;
      else throw e;
    }
    throw new RuntimeException("Any exception was expected");
  }