|
|
@ -9,12 +9,13 @@ import de.tims.fleetstorm.matchfield.Coordinate; |
|
|
|
import de.tims.fleetstorm.matchfield.Matchfield; |
|
|
|
|
|
|
|
class LogicTest { |
|
|
|
Logic logic = new Logic(); |
|
|
|
int size = 3; |
|
|
|
private Matchfield matchfield = new Matchfield(size); |
|
|
|
|
|
|
|
@Test |
|
|
|
void testFieldIsNotNull() { |
|
|
|
Logic logic = new Logic(); |
|
|
|
Matchfield matchfield; |
|
|
|
int size = 5; |
|
|
|
matchfield = new Matchfield(size); |
|
|
|
matchfield.createMatchfield(); |
|
|
|
Coordinate calcResult = logic.chooseField(matchfield); |
|
|
|
assertNotNull(calcResult); |
|
|
@ -22,7 +23,12 @@ class LogicTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void testChoosenFieldHasNotStateShot() { |
|
|
|
Logic logic = new Logic(); |
|
|
|
Matchfield matchfield; |
|
|
|
int size = 5; |
|
|
|
matchfield = new Matchfield(size); |
|
|
|
matchfield.createMatchfield(); |
|
|
|
|
|
|
|
for (int x = 0; x < size; x++) { |
|
|
|
for (int y = 0; y < size; y++) { |
|
|
|
// matchfield.setState(x, y, Matchfield.SHOT); |
|
|
|