|
|
@ -0,0 +1,26 @@ |
|
|
|
package pacmanTests; |
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import pacmanGame.*; |
|
|
|
|
|
|
|
|
|
|
|
class CellTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void cell_triggerItem_505cherryScore() { |
|
|
|
// arrange |
|
|
|
GameManager gameManager = new GameManager(); |
|
|
|
Cell cell = gameManager.map.GetCell(new Vector2(0,0)); |
|
|
|
cell.type = "cherry"; |
|
|
|
int expectedScore = 505; |
|
|
|
// act |
|
|
|
cell.triggerItem(); |
|
|
|
int resultingScore = gameManager.score; |
|
|
|
// assert |
|
|
|
assertThat(expectedScore).isEqualTo(resultingScore); |
|
|
|
} |
|
|
|
} |