summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/test/ch/asynk/tankontank/BoardUtils.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/core/test/ch/asynk/tankontank/BoardUtils.java b/core/test/ch/asynk/tankontank/BoardUtils.java
index cea97ff..21a65be 100644
--- a/core/test/ch/asynk/tankontank/BoardUtils.java
+++ b/core/test/ch/asynk/tankontank/BoardUtils.java
@@ -2,10 +2,13 @@ package ch.asynk.tankontank;
import java.util.List;
import java.util.Vector;
+import java.util.HashSet;
import org.junit.Test;
import org.junit.Before;
+import com.badlogic.gdx.math.GridPoint2;
+
import ch.asynk.tankontank.engine.SearchBoard;
import static org.junit.Assert.assertTrue;
@@ -13,14 +16,15 @@ import static org.junit.Assert.assertTrue;
public class BoardUtils
{
private SearchBoard sb;
+ private Helpers.FakeBoard b;
@Before
public void initialize()
{
int cols = 10;
int rows = 9;
- Helpers.FakeBoard fakeBoard = new Helpers.FakeBoard(cols, rows);
- sb = new SearchBoard(fakeBoard, cols, rows);
+ b = new Helpers.FakeBoard(cols, rows);
+ sb = new SearchBoard(b, cols, rows);
}
@Test
@@ -99,6 +103,16 @@ public class BoardUtils
}
@Test
+ public void testPathSet()
+ {
+ Helpers.FakePawn p = new Helpers.FakePawn(3);
+ HashSet<GridPoint2> points = new HashSet<GridPoint2>();
+
+ b.possiblePaths(p, 2, 2, 4, 3, points);
+ assertTrue(points.size() == 8);
+ }
+
+ @Test
public void testDistance()
{