From 3469d5542f2022e01b3af966a804803256b1f553 Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Thu, 8 Feb 2024 02:38:43 +0100 Subject: [PATCH] added test for crystal score --- src/test/java/pacmanTests/CellTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/pacmanTests/CellTest.java b/src/test/java/pacmanTests/CellTest.java index 98c26e1..58c0c35 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -94,6 +94,20 @@ class CellTest { assertThat(expectedScore).isEqualTo(resultingScore); } + @Test + void cell_triggerItem_506crystalScore() { + // arrange + GameManager gameManager = new GameManager(); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); + cell.type = "crystal"; + int expectedScore = 506; + // act + cell.triggerItem(); + int resultingScore = gameManager.score; + // assert + assertThat(expectedScore).isEqualTo(resultingScore); + } + @Test void cell_triggerItem_3crystalMoveSpeed() { // arrange