From d847e33ef59403e16faf0cffc7901e5e3908bf93 Mon Sep 17 00:00:00 2001 From: Max Wenzel Date: Wed, 12 Jan 2022 17:00:53 +0100 Subject: [PATCH] Refact6oring: ai-logicTest restructured --- src/test/java/de/tims/fleetstorm/ai/LogicTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/tims/fleetstorm/ai/LogicTest.java b/src/test/java/de/tims/fleetstorm/ai/LogicTest.java index 7c472aa..9a201d8 100644 --- a/src/test/java/de/tims/fleetstorm/ai/LogicTest.java +++ b/src/test/java/de/tims/fleetstorm/ai/LogicTest.java @@ -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);