Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void testMove_nextOnStar() {
- System.out.println("move, next on star and win");
- board = new Board(new Square[][]{
- {new Square(GRASS), new Square(GRASS), new Square(STAR), new Square(GRASS)},
- {null, new Square(GRASS), new Square(GRASS), null},
- {null, null, new Square(STAR), null}
- });
- animals = new Animal[] {
- new Spider(new Position(0, 0)),
- new Snail(new Position(0, 3))
- };
- Spider instance = (Spider) animals[0];
- Position expResult = new Position(0, 2);
- Position result = instance.move(board, Direction.EAST, animals);
- assertEquals(expResult, result);
- assertTrue(animals[0].isOnStar());
- assertEquals(GRASS, board.getSquareType(result));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement