|
|
@ -23,7 +23,7 @@ class LogicTest { |
|
|
|
logic.setMatchfield(matchfield); |
|
|
|
ArrayList<Coordinate> everySecondField = logic.getEverySecondField(); |
|
|
|
|
|
|
|
Coordinate calcResult = logic.chooseField(everySecondField); |
|
|
|
Coordinate calcResult = logic.chooseField(); |
|
|
|
assertNotNull(calcResult); |
|
|
|
} |
|
|
|
|
|
|
@ -42,7 +42,7 @@ class LogicTest { |
|
|
|
} |
|
|
|
matchfield.setState(2, 2, Coordinate.EMPTY); |
|
|
|
|
|
|
|
Coordinate choosenField = logic.chooseField(everySecondField); |
|
|
|
Coordinate choosenField = logic.chooseField(); |
|
|
|
int calcState = matchfield.getState(choosenField.getX(), choosenField.getY()); |
|
|
|
assertNotEquals(calcState, Coordinate.SHOT); |
|
|
|
} |
|
|
@ -270,7 +270,7 @@ class LogicTest { |
|
|
|
logic.setTarget(center); |
|
|
|
logic.setFoundShip(true); |
|
|
|
|
|
|
|
Coordinate result = logic.chooseField(logic.getEverySecondField()); |
|
|
|
Coordinate result = logic.chooseField(); |
|
|
|
assertEquals(result, expectedResult); |
|
|
|
} |
|
|
|
|
|
|
@ -289,8 +289,8 @@ class LogicTest { |
|
|
|
logic.setTarget(center); |
|
|
|
logic.setFoundShip(true); |
|
|
|
|
|
|
|
logic.chooseField(logic.getEverySecondField()); // first Shot |
|
|
|
Coordinate result = logic.chooseField(logic.getEverySecondField()); // second Shot |
|
|
|
logic.chooseField(); // first Shot |
|
|
|
Coordinate result = logic.chooseField(); // second Shot |
|
|
|
|
|
|
|
assertEquals(result, expectedResult); |
|
|
|
} |
|
|
@ -310,9 +310,9 @@ class LogicTest { |
|
|
|
logic.setTarget(center); |
|
|
|
logic.setFoundShip(true); |
|
|
|
|
|
|
|
logic.chooseField(logic.getEverySecondField()); // first Shot |
|
|
|
logic.chooseField(logic.getEverySecondField()); // second Shot |
|
|
|
Coordinate result = logic.chooseField(logic.getEverySecondField()); |
|
|
|
logic.chooseField(); // first Shot |
|
|
|
logic.chooseField(); // second Shot |
|
|
|
Coordinate result = logic.chooseField(); |
|
|
|
|
|
|
|
assertEquals(result, expectedResult); |
|
|
|
} |
|
|
@ -332,11 +332,12 @@ class LogicTest { |
|
|
|
logic.setTarget(center); |
|
|
|
logic.setFoundShip(true); |
|
|
|
|
|
|
|
logic.chooseField(logic.getEverySecondField()); // first Shot |
|
|
|
logic.chooseField(logic.getEverySecondField()); // second Shot |
|
|
|
logic.chooseField(logic.getEverySecondField()); // third Shot |
|
|
|
Coordinate result = logic.chooseField(logic.getEverySecondField()); |
|
|
|
logic.chooseField(); // first Shot |
|
|
|
logic.chooseField(); // second Shot |
|
|
|
logic.chooseField(); // third Shot |
|
|
|
Coordinate result = logic.chooseField(); |
|
|
|
|
|
|
|
assertEquals(result, expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
} |