From fab9670220e5aa8ae3dd70020318f4b299cf58c7 Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Mon, 5 Feb 2024 21:35:42 +0100 Subject: [PATCH] added test for strawberry --- src/test/java/pacmanTests/CellTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/java/pacmanTests/CellTest.java b/src/test/java/pacmanTests/CellTest.java index ca10733..ba78b06 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -50,5 +50,16 @@ class CellTest { assertThat(expectedScore).isEqualTo(resultingScore); } - + void cell_triggerItem_405strawberryScore() { + // arrange + GameManager gameManager = new GameManager(); + Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + cell.type = "strawberry"; + int expectedScore = 405; + // act + cell.triggerItem(); + int resultingScore = gameManager.score; + // assert + assertThat(expectedScore).isEqualTo(resultingScore); + } }