From c129d69538b0e7f17922150132c74affe7c2fb51 Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Mon, 5 Feb 2024 20:52:33 +0100 Subject: [PATCH] added test for dotScore --- src/test/java/pacmanTests/CellTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/pacmanTests/CellTest.java b/src/test/java/pacmanTests/CellTest.java index 9c65b44..d3a5db5 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -23,4 +23,19 @@ class CellTest { // assert assertThat(expectedScore).isEqualTo(resultingScore); } + + void cell_triggerItem_10dotScore() { + // arrange + GameManager gameManager = new GameManager(); + Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + cell.type = "dot"; + int expectedScore = 10; + // act + cell.triggerItem(); + int resultingScore = gameManager.score; + // assert + assertThat(expectedScore).isEqualTo(resultingScore); + } + + }