Browse Source

added test for crystal score

main
fdai7910 11 months ago
parent
commit
3469d5542f
  1. 14
      src/test/java/pacmanTests/CellTest.java

14
src/test/java/pacmanTests/CellTest.java

@ -94,6 +94,20 @@ class CellTest {
assertThat(expectedScore).isEqualTo(resultingScore); assertThat(expectedScore).isEqualTo(resultingScore);
} }
@Test
void cell_triggerItem_506crystalScore() {
// arrange
GameManager gameManager = new GameManager();
Cell cell = gameManager.map.getCell(new Vector2(0,0));
cell.type = "crystal";
int expectedScore = 506;
// act
cell.triggerItem();
int resultingScore = gameManager.score;
// assert
assertThat(expectedScore).isEqualTo(resultingScore);
}
@Test @Test
void cell_triggerItem_3crystalMoveSpeed() { void cell_triggerItem_3crystalMoveSpeed() {
// arrange // arrange

Loading…
Cancel
Save