|
@ -43,6 +43,12 @@ class SnakeTest { |
|
|
assertEquals(new Point(gridSize / 2 + 1, gridSize / 2 - 1), bodySegments.get(0)); |
|
|
assertEquals(new Point(gridSize / 2 + 1, gridSize / 2 - 1), bodySegments.get(0)); |
|
|
assertEquals(new Point(gridSize / 2, gridSize / 2 - 1), bodySegments.get(1)); |
|
|
assertEquals(new Point(gridSize / 2, gridSize / 2 - 1), bodySegments.get(1)); |
|
|
|
|
|
|
|
|
|
|
|
snake.setDirection(Snake.SnakeDirection.DOWN); |
|
|
|
|
|
snake.update(); |
|
|
|
|
|
bodySegments = snake.getBodySegments(); |
|
|
|
|
|
assertEquals(new Point(gridSize / 2 + 1, gridSize / 2), bodySegments.get(0)); |
|
|
|
|
|
assertEquals(new Point(gridSize / 2 + 1, gridSize / 2 - 1), bodySegments.get(1)); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|