|
|
@ -37,5 +37,16 @@ class AIHardTest { |
|
|
|
|
|
|
|
verify(gl, times(1)).setField(0, 0, realChar); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void opponentDidntChooseMiddleFieldSoAIDoes() { |
|
|
|
char realChar = 'o'; |
|
|
|
doReturn(new char[][] { {'-', '-', 'x'}, {'-', '-', '-'}, {'-', '-', '-'} }).when(gl).getBoard(); |
|
|
|
|
|
|
|
TicTacToeAI ai = new AIHard(gl); |
|
|
|
ai.calculateNextMove(); |
|
|
|
|
|
|
|
verify(gl, times(1)).setField(1, 1, realChar); |
|
|
|
} |
|
|
|
|
|
|
|
} |