|
@ -2,6 +2,11 @@ import static org.assertj.core.api.Assertions.*; |
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
|
|
|
import org.junit.jupiter.params.provider.MethodSource; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
public class GameboardTest { |
|
|
public class GameboardTest { |
|
|
|
|
|
|
|
@ -14,23 +19,22 @@ public class GameboardTest { |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkGameboardSize() { |
|
|
void checkGameboardSize() { |
|
|
String expectedResult = "11, 11"; |
|
|
|
|
|
String currentResult = "" + gb.board.length + ", " + gb.board[0].length; |
|
|
|
|
|
|
|
|
String expectedResult = "11"; |
|
|
|
|
|
String currentResult = "" + gb.board.length; |
|
|
|
|
|
|
|
|
assertThat(currentResult).describedAs("Dimensions").isEqualTo(expectedResult); |
|
|
assertThat(currentResult).describedAs("Dimensions").isEqualTo(expectedResult); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkGameboardFilled() { |
|
|
void checkGameboardFilled() { |
|
|
int[][] expectedGameboard = new int[11][11]; |
|
|
|
|
|
|
|
|
int[] expectedGameboard = new int[11]; |
|
|
for(int i = 0; i < expectedGameboard.length; i++) { |
|
|
for(int i = 0; i < expectedGameboard.length; i++) { |
|
|
for(int j = 0; j < expectedGameboard[0].length; j++) { |
|
|
|
|
|
expectedGameboard[i][j] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
expectedGameboard[i] = 0; |
|
|
} |
|
|
} |
|
|
int [][] givenGameboard = gb.board; |
|
|
|
|
|
|
|
|
int [] givenGameboard = gb.board; |
|
|
|
|
|
|
|
|
assertThat(givenGameboard).describedAs("Initial Gameboard").isEqualTo(expectedGameboard); |
|
|
assertThat(givenGameboard).describedAs("Initial Gameboard").isEqualTo(expectedGameboard); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |