Advertisement
akwatic97460

Untitled

Mar 29th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. @Test
  2. public void testMove_nextOnStar() {
  3. System.out.println("move, next on star and win");
  4. board = new Board(new Square[][]{
  5. {new Square(GRASS), new Square(GRASS), new Square(STAR), new Square(GRASS)},
  6. {null, new Square(GRASS), new Square(GRASS), null},
  7. {null, null, new Square(STAR), null}
  8. });
  9. animals = new Animal[] {
  10. new Spider(new Position(0, 0)),
  11. new Snail(new Position(0, 3))
  12. };
  13. Spider instance = (Spider) animals[0];
  14. Position expResult = new Position(0, 2);
  15. Position result = instance.move(board, Direction.EAST, animals);
  16. assertEquals(expResult, result);
  17. assertTrue(animals[0].isOnStar());
  18. assertEquals(GRASS, board.getSquareType(result));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement