From 2ecad6f7944a2db24cfaec03df0639bc662c6d13 Mon Sep 17 00:00:00 2001 From: Justin Senn Date: Wed, 8 Feb 2023 19:53:11 +0100 Subject: [PATCH] Update Unit Test Snake --- src/test/java/SnakeTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/SnakeTest.java b/src/test/java/SnakeTest.java index 22130a9..1658151 100644 --- a/src/test/java/SnakeTest.java +++ b/src/test/java/SnakeTest.java @@ -31,6 +31,12 @@ class SnakeTest { Snake snake = new Snake(gridSize); snake.reset(); + snake.setDirection(Snake.SnakeDirection.UP); + snake.update(); + ArrayList bodySegments = snake.getBodySegments(); + assertEquals(new Point(gridSize / 2, gridSize / 2 - 1), bodySegments.get(0)); + assertEquals(new Point(gridSize / 2, gridSize / 2), bodySegments.get(1)); + }