From 0f58fd0680c22ccdee7810f15c6b12872642eb1a Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Mon, 5 Feb 2024 21:42:24 +0100 Subject: [PATCH] added test for apple --- src/test/java/pacmanTests/CellTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/pacmanTests/CellTest.java b/src/test/java/pacmanTests/CellTest.java index e22e328..afa318c 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -74,4 +74,17 @@ class CellTest { // assert assertThat(expectedScore).isEqualTo(resultingScore); } + + void cell_triggerItem_205appleScore() { + // arrange + GameManager gameManager = new GameManager(); + Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + cell.type = "apple"; + int expectedScore = 205; + // act + cell.triggerItem(); + int resultingScore = gameManager.score; + // assert + assertThat(expectedScore).isEqualTo(resultingScore); + } }