summaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-30 22:09:35 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-30 22:09:35 +0100
commitbc458868136cd2a841a642e187f2f5ffc19a7b9d (patch)
tree9c7e29643de11d94b80a56ababf4a94bc2cdf778 /core/test
parent57f06d82d75e81f2ccafc1b232180cbf9b01ce3f (diff)
downloadRustAndDust-bc458868136cd2a841a642e187f2f5ffc19a7b9d.zip
RustAndDust-bc458868136cd2a841a642e187f2f5ffc19a7b9d.tar.gz
tests: fix toggle ctrl path points tests
Diffstat (limited to 'core/test')
-rw-r--r--core/test/ch/asynk/rustanddust/BoardUtils.java39
-rw-r--r--core/test/ch/asynk/rustanddust/Helpers.java4
2 files changed, 36 insertions, 7 deletions
diff --git a/core/test/ch/asynk/rustanddust/BoardUtils.java b/core/test/ch/asynk/rustanddust/BoardUtils.java
index 2e36f4c..a051d45 100644
--- a/core/test/ch/asynk/rustanddust/BoardUtils.java
+++ b/core/test/ch/asynk/rustanddust/BoardUtils.java
@@ -97,24 +97,53 @@ public class BoardUtils
n = b.buildPathBuilder(2, 2, 4, 3);
assertTrue(n == 8);
- n = b.togglePoint(3, 3);
+ n = b.togglePoint(3, 3, false);
+ assertTrue(n == 5);
+
+ n = b.togglePoint(3, 2, false);
+ assertTrue(n == 2);
+
+ n = b.togglePoint(3, 3, false);
+ assertTrue(n == 5);
+
+ n = b.togglePoint(3, 2, false);
+ assertTrue(n == 8);
+
+ n = b.togglePoint(3, 3, true);
assertTrue(n == 1);
n = b.buildPathBuilder(2, 2, 5, 3);
assertTrue(n == 3);
- n = b.togglePoint(3, 3);
+ n = b.togglePoint(3, 3, true);
assertTrue(n == 1);
- n = b.togglePoint(3, 3);
+ n = b.togglePoint(3, 3, true);
assertTrue(n == 3);
- n = b.togglePoint(3, 2);
+ n = b.togglePoint(3, 3, false);
+ assertTrue(n == 1);
+
+ n = b.togglePoint(3, 3, false);
+ assertTrue(n == 3);
+
+ n = b.togglePoint(3, 2, true);
assertTrue(n == 2);
- n = b.togglePoint(4, 2);
+ n = b.togglePoint(4, 2, true);
assertTrue(n == 1);
+ n = b.togglePoint(4, 2, true);
+ assertTrue(n == 2);
+
+ n = b.togglePoint(3, 2, true);
+ assertTrue(n == 3);
+
+ n = b.togglePoint(3, 2, false);
+ assertTrue(n == 2);
+
+ n = b.togglePoint(4, 2, false);
+ assertTrue(n == 1);
}
@Test
diff --git a/core/test/ch/asynk/rustanddust/Helpers.java b/core/test/ch/asynk/rustanddust/Helpers.java
index 9ca9761..f3aaec5 100644
--- a/core/test/ch/asynk/rustanddust/Helpers.java
+++ b/core/test/ch/asynk/rustanddust/Helpers.java
@@ -146,9 +146,9 @@ public class Helpers
return pathBuilder.build(getTile(x1, y1));
}
- public int togglePoint(int x, int y)
+ public int togglePoint(int x, int y, boolean quick)
{
- return pathBuilder.toggleCtrlTile(getTile(x, y));
+ return pathBuilder.toggleCtrlTile(getTile(x, y), quick);
}
}
}