From 31cb38ac08cf4e5709ea607c31478d8c9c00db3d Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Mon, 5 Feb 2024 22:20:29 +0100 Subject: [PATCH] added test for moveSpeed change by crystal fruit --- 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 afa318c..790f5ed 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -87,4 +87,17 @@ class CellTest { // assert assertThat(expectedScore).isEqualTo(resultingScore); } + + void cell_triggerItem_3crystalMoveSpeed() { + // arrange + GameManager gameManager = new GameManager(); + Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + cell.type = "crystal"; + int expectedMoveSpeed = 3; + // act + cell.triggerItem(); + int resultingMoveSpeed = gameManager.moveSpeed; + // assert + assertThat(expectedMoveSpeed).isEqualTo(resultingMoveSpeed); + } }