refactor gametest
This commit is contained in:
@@ -290,7 +290,6 @@ public class Game implements GameSpecification {
|
|||||||
* If the car is passing the finishline in the correct direction, the car will gain a winpoint.
|
* If the car is passing the finishline in the correct direction, the car will gain a winpoint.
|
||||||
* @param start the startposition of the car
|
* @param start the startposition of the car
|
||||||
* @param finish the expected finishpositon of the car after the move
|
* @param finish the expected finishpositon of the car after the move
|
||||||
* @param carIndex of the current player.
|
|
||||||
*/
|
*/
|
||||||
private void calculateWinner(PositionVector start, PositionVector finish, int carIndex) {
|
private void calculateWinner(PositionVector start, PositionVector finish, int carIndex) {
|
||||||
List<PositionVector> path = calculatePath(start, finish);
|
List<PositionVector> path = calculatePath(start, finish);
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ public class Track implements TrackSpecification {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return ConfigSpecification.SpaceType.WALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ class GameTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void winner() {
|
void winner() {
|
||||||
game = new Game(new interFace("Test",new Integer[]{0,2,1},new PositionVector.Direction[]{RIGHT,
|
game = new Game(new interFace("Test",new Integer[]{0,2,0},new PositionVector.Direction[]{RIGHT,
|
||||||
RIGHT,
|
RIGHT,
|
||||||
RIGHT,
|
RIGHT,
|
||||||
NONE,
|
NONE,
|
||||||
@@ -178,7 +178,7 @@ class GameTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void crashA() {
|
void crashA() {
|
||||||
game = new Game(new interFace("Test",new Integer[]{0,2,2},new PositionVector.Direction[]{UP}));
|
game = new Game(new interFace("Test",new Integer[]{0,1,1},new PositionVector.Direction[]{UP}));
|
||||||
game.initPhase();
|
game.initPhase();
|
||||||
Assertions.assertEquals("b",game.gamePhase());
|
Assertions.assertEquals("b",game.gamePhase());
|
||||||
}
|
}
|
||||||
@@ -187,8 +187,8 @@ class GameTest {
|
|||||||
|
|
||||||
private class interFace extends UserInterface {
|
private class interFace extends UserInterface {
|
||||||
|
|
||||||
private final PositionVector.Direction[] directions;
|
private PositionVector.Direction[] directions;
|
||||||
private final Integer[] instructions;
|
private Integer[] instructions;
|
||||||
private int pointerDir,pointerInstruction;
|
private int pointerDir,pointerInstruction;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user