added small improvements in GameTest
This commit is contained in:
parent
9d8e699c02
commit
4a955c2978
|
@ -29,6 +29,9 @@ class GameTest {
|
||||||
@DisplayName("Test correct Setup")
|
@DisplayName("Test correct Setup")
|
||||||
class Setup {
|
class Setup {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets up getting the Config, Game and Userinterface for the following tests.
|
||||||
|
*/
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setup() {
|
void setup() {
|
||||||
userInterface = new UserInterface("Test");
|
userInterface = new UserInterface("Test");
|
||||||
|
@ -139,6 +142,9 @@ class GameTest {
|
||||||
Assertions.assertEquals(new PositionVector(1, 0), game.getCarVelocity(0));
|
Assertions.assertEquals(new PositionVector(1, 0), game.getCarVelocity(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if car crash is set if a car crashes.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
void carCrash() {
|
void carCrash() {
|
||||||
game.doCarTurn(PositionVector.Direction.UP);
|
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.
|
* 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
|
@Nested
|
||||||
@DisplayName("Playtrough")
|
@DisplayName("Playtrough")
|
||||||
|
@ -256,6 +262,7 @@ class GameTest {
|
||||||
this.directions = directions;
|
this.directions = directions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int selectOption(String text, List<String> options) {
|
public int selectOption(String text, List<String> options) {
|
||||||
pointerInstruction++;
|
pointerInstruction++;
|
||||||
|
@ -263,6 +270,7 @@ class GameTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void printInformation(String text) {
|
public void printInformation(String text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue