diff --git a/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogicTest.java b/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogicTest.java index 97af980..98b99db 100644 --- a/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogicTest.java +++ b/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogicTest.java @@ -208,23 +208,17 @@ class GameLogicTest { ArrayList result = GameLogic.Bresenham4Connected(a, b); - StringBuilder sb = new StringBuilder(); - for(int y = 0; y < size; y++) { - for(int x = 0; x < size; x++) { - IntVector2 pos = new IntVector2(x, y); - if(pos.equals(a)) { - sb.append("A "); - }else if(pos.equals(b)) { - sb.append("B "); - }else if(result.contains(pos)) { - sb.append("o "); - }else { - sb.append(". "); - } + assertEquals(result.get(0), a, "Start point should be point A"); + assertEquals(result.get(result.size() - 1), b, "End point should be point B"); + + IntVector2 old = a; + for(IntVector2 pos: result) { + if(pos.equals(a)) { + continue; } - sb.append("\n"); + assertEquals(1, old.distanceManhattan(pos), "Distance between every step should be 1"); + old = pos; } - System.out.println(sb.toString()); }