Exemple #1
0
  @Test
  public void shouldNotMoveOnTheSamePlace() {
    givenFl("☼☼☼☼☼" + "☼  ☻☼" + "☼   ☼" + "☼  ☺☼" + "☼☼☼☼☼");

    joystick2.act(3, 3);
    joystick2.down();
    joystick1.act(3, 1);
    joystick1.up();
    game.tick();

    assertE("☼☼☼☼☼" + "☼  ☻☼" + "☼  ☼☼" + "☼  ☺☼" + "☼☼☼☼☼");

    assertEquals(1, player1.getHeroes().size());
    assertEquals(1, player2.getHeroes().size());
  }
Exemple #2
0
  private void setupPlayer2() {
    listener2 = mock(EventListener.class);
    player2 = new Player(listener2, game);
    joystick2 = player2.getJoystick();

    dice(hero2.getX(), hero2.getY());

    game.newGame(player2);
    hero2.init(game);
  }
Exemple #3
0
  private void setupPlayer1() {
    listener1 = mock(EventListener.class);
    player1 = new Player(listener1, game);
    joystick1 = player1.getJoystick();

    dice(hero1.getX(), hero1.getY());

    game.newGame(player1);
    hero1.init(game);
  }
 private void playerIsAdmin() {
   mockPlayer = mock(Player.class);
   when(mockPlayer.getName()).thenReturn("Admin");
   when(mockPlayer.hasPermission("chunkclaim.admin")).thenReturn(true);
   when(mockChunk.isTrusted("ThatPlayer")).thenReturn(false);
 }
 private void playerIsTrusted() {
   mockPlayer = mock(Player.class);
   when(mockPlayer.getName()).thenReturn("ThatPlayer");
   when(mockChunk.isTrusted("ThatPlayer")).thenReturn(true);
 }