From dc885ef28554a0cfbdbfd82e570ac585aab34966 Mon Sep 17 00:00:00 2001 From: Justin Senn Date: Wed, 8 Feb 2023 19:45:59 +0100 Subject: [PATCH] Update Unit Test Snake --- src/test/java/SnakeTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/SnakeTest.java b/src/test/java/SnakeTest.java index 3695992..8f8a6da 100644 --- a/src/test/java/SnakeTest.java +++ b/src/test/java/SnakeTest.java @@ -3,6 +3,8 @@ import Snake.Snake; import java.awt.*; import java.util.ArrayList; +import static org.junit.jupiter.api.Assertions.assertEquals; + class SnakeTest { public void testReset() { @@ -13,6 +15,11 @@ class SnakeTest { ArrayList bodySegments = snake.getBodySegments(); Snake.SnakeDirection direction = Snake.SnakeDirection.UP; + assertEquals(3, bodySegments.size()); + assertEquals(new Point(gridSize / 2, gridSize / 2), bodySegments.get(0)); + assertEquals(new Point(gridSize / 2, gridSize / 2 + 1), bodySegments.get(1)); + assertEquals(new Point(gridSize / 2, gridSize / 2 + 2), bodySegments.get(2)); + assertEquals(Snake.SnakeDirection.UP, direction); }