|
|
@ -27,4 +27,15 @@ 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); |
|
|
|
} |
|
|
|
|
|
|
|
} |