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