diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/test/ch/asynk/rustanddust/BoardUtils.java | 39 | ||||
-rw-r--r-- | core/test/ch/asynk/rustanddust/Helpers.java | 4 |
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); } } } |