|
|
@ -20,7 +20,8 @@ class LogicTest { |
|
|
|
int size = 5; |
|
|
|
matchfield = new Matchfield(size); |
|
|
|
matchfield.createMatchfield(); |
|
|
|
Coordinate calcResult = logic.chooseField(matchfield); |
|
|
|
logic.setMatchfield(matchfield); |
|
|
|
Coordinate calcResult = logic.chooseField(); |
|
|
|
assertNotNull(calcResult); |
|
|
|
} |
|
|
|
|
|
|
@ -31,6 +32,7 @@ class LogicTest { |
|
|
|
int size = 5; |
|
|
|
matchfield = new Matchfield(size); |
|
|
|
matchfield.createMatchfield(); |
|
|
|
logic.setMatchfield(matchfield); |
|
|
|
|
|
|
|
for (int x = 0; x < size; x++) { |
|
|
|
for (int y = 0; y < size; y++) { |
|
|
@ -39,7 +41,7 @@ class LogicTest { |
|
|
|
} |
|
|
|
matchfield.setState(2, 2, Coordinate.EMPTY); |
|
|
|
|
|
|
|
Coordinate choosenField = logic.chooseField(matchfield); |
|
|
|
Coordinate choosenField = logic.chooseField(); |
|
|
|
int calcState = matchfield.getState(choosenField.getX(), choosenField.getY()); |
|
|
|
assertNotEquals(calcState, Coordinate.SHOT); |
|
|
|
} |
|
|
|