From 079f330c117b461ef3f83e9ac679b1d6ea81854d Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Mon, 5 Feb 2024 20:54:49 +0100 Subject: [PATCH] added test for pillScore --- 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 d3a5db5..ca10733 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -37,5 +37,18 @@ class CellTest { assertThat(expectedScore).isEqualTo(resultingScore); } + void cell_triggerItem_100pillScore() { + // arrange + GameManager gameManager = new GameManager(); + Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + cell.type = "pill"; + int expectedScore = 100; + // act + cell.triggerItem(); + int resultingScore = gameManager.score; + // assert + assertThat(expectedScore).isEqualTo(resultingScore); + } + }