From a8c65719b20f8a33f912822c6c64eded04025099 Mon Sep 17 00:00:00 2001 From: Justin Senn Date: Wed, 8 Feb 2023 19:53:54 +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 9242420..7a13ec1 100644 --- a/src/test/java/SnakeTest.java +++ b/src/test/java/SnakeTest.java @@ -43,6 +43,12 @@ class SnakeTest { assertEquals(new Point(gridSize / 2 + 1, gridSize / 2 - 1), bodySegments.get(0)); 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)); + }