added small improvements in GameTest

This commit is contained in:
Leonardo Brandenberger 2022-03-25 23:47:48 +01:00
parent 9d8e699c02
commit 4a955c2978
1 changed files with 9 additions and 1 deletions

View File

@ -29,6 +29,9 @@ class GameTest {
@DisplayName("Test correct Setup")
class Setup {
/**
* Sets up getting the Config, Game and Userinterface for the following tests.
*/
@BeforeEach
void setup() {
userInterface = new UserInterface("Test");
@ -139,6 +142,9 @@ class GameTest {
Assertions.assertEquals(new PositionVector(1, 0), game.getCarVelocity(0));
}
/**
* Checks if car crash is set if a car crashes.
*/
@Test
void carCrash() {
game.doCarTurn(PositionVector.Direction.UP);
@ -148,7 +154,7 @@ class GameTest {
/**
* This nested Class tests a play trough and implements a userInterface which pretends to be a real player.
* At the end of every Test the userinterface stays open for 10 more sec to visualize the game.
* At the end of every Test the user interface stays open for 10 more sec to visualize the game.
*/
@Nested
@DisplayName("Playtrough")
@ -256,6 +262,7 @@ class GameTest {
this.directions = directions;
}
@Override
public int selectOption(String text, List<String> options) {
pointerInstruction++;
@ -263,6 +270,7 @@ class GameTest {
}
public void printInformation(String text) {
}