Browse Source

added test for dotScore

remotes/origin/player
fdai7910 11 months ago
parent
commit
c129d69538
  1. 15
      src/test/java/pacmanTests/CellTest.java

15
src/test/java/pacmanTests/CellTest.java

@ -23,4 +23,19 @@ class CellTest {
// assert // assert
assertThat(expectedScore).isEqualTo(resultingScore); 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);
}
} }
Loading…
Cancel
Save