|
|
@ -13,12 +13,20 @@ public class GameTest { |
|
|
|
|
|
|
|
private Game g; |
|
|
|
private Player p1; |
|
|
|
private Game g2; |
|
|
|
private Player p2; |
|
|
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
void setup() { |
|
|
|
g = new Game(); |
|
|
|
p1 = g.players.get(0); |
|
|
|
|
|
|
|
g2 = new Game(); |
|
|
|
p2 = g2.players.get(0); |
|
|
|
p2.figures.get(0).setPosition(5); |
|
|
|
p2.figures.get(1).setPosition(10); |
|
|
|
g2.players.get(3).figures.get(1).setPosition(14); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
@ -151,6 +159,20 @@ public class GameTest { |
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("setFigureData") |
|
|
|
void setFigureTest(String testname, int figId, int dice, int expectedResult) { |
|
|
|
int calculatedResult = g.setFigure(figId, dice, p2, g2); |
|
|
|
assertThat(calculatedResult).describedAs(testname).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> setFigureData () { |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Figur wird auf Feld gesetzt - Niemand gekicked", 0, 4, 0), |
|
|
|
Arguments.of("Figur wird auf Feld gesetzt - Jemand gekicked", 1, 4, 1) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|