|
|
@ -19,7 +19,7 @@ public class GameboardTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void checkGameboardSize() { |
|
|
|
String expectedResult = "11"; |
|
|
|
String expectedResult = "56"; |
|
|
|
String currentResult = "" + gb.board.length; |
|
|
|
|
|
|
|
assertThat(currentResult).describedAs("Dimensions").isEqualTo(expectedResult); |
|
|
@ -27,7 +27,7 @@ public class GameboardTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void checkGameboardFilled() { |
|
|
|
int[] expectedGameboard = new int[11]; |
|
|
|
int[] expectedGameboard = new int[56]; |
|
|
|
for(int i = 0; i < expectedGameboard.length; i++) { |
|
|
|
expectedGameboard[i] = 0; |
|
|
|
} |
|
|
@ -36,5 +36,28 @@ public class GameboardTest { |
|
|
|
assertThat(givenGameboard).describedAs("Initial Gameboard").isEqualTo(expectedGameboard); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("FieldStream") |
|
|
|
void checkGameboardFieldType(String testname, int Pos, int expectedResult) { |
|
|
|
gb.initGameboard(); |
|
|
|
int currentType = gb.board[Pos]; |
|
|
|
assertThat(currentType).describedAs("Field Type").isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> FieldStream () { |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Normal Path", 1, 0), |
|
|
|
Arguments.of("Starting Field", 0, 1), |
|
|
|
Arguments.of("Starting Field", 10, 1), |
|
|
|
Arguments.of("Starting Field", 20, 1), |
|
|
|
Arguments.of("Starting Field", 30, 1), |
|
|
|
Arguments.of("Doorway Field", 9, 2), |
|
|
|
Arguments.of("Doorway Field", 19, 2), |
|
|
|
Arguments.of("Doorway Field", 29, 2), |
|
|
|
Arguments.of("Doorway Field", 39, 2), |
|
|
|
Arguments.of("House Field", 40, 3), |
|
|
|
Arguments.of("House Field", 55, 3) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |