From bc458868136cd2a841a642e187f2f5ffc19a7b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 30 Dec 2015 22:09:35 +0100 Subject: tests: fix toggle ctrl path points tests --- core/test/ch/asynk/rustanddust/BoardUtils.java | 39 ++++++++++++++++++++++---- 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); } } } -- cgit v1.1-2-g2b99