diff options
| author | mo khan <mo@mokhan.ca> | 2019-08-05 12:56:13 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-08-05 12:56:13 -0600 |
| commit | e223a77d5f044b663ed207ac0990f28e4ac949ed (patch) | |
| tree | 3413bf48fedd3f11a13296b83c4351e849da2491 /src/Q9/MovingRobotTest.java | |
| parent | b80955c9102596bdc97cce97df87e9990de606b8 (diff) | |
start to print the grid
Diffstat (limited to 'src/Q9/MovingRobotTest.java')
| -rw-r--r-- | src/Q9/MovingRobotTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Q9/MovingRobotTest.java b/src/Q9/MovingRobotTest.java index 275c071..dbc5671 100644 --- a/src/Q9/MovingRobotTest.java +++ b/src/Q9/MovingRobotTest.java @@ -143,4 +143,17 @@ public class MovingRobotTest extends TestCase { subject.move(Robot.RIGHT); assertEquals(String.format("%d,%d", Robot.RIGHT, Robot.RIGHT), subject.printMoves()); } + + public void test_printGrid() { + Robot r1 = new MovingRobot(0, 0); + Robot r2 = new MovingRobot(9, 9); + + String expected = "|X| | | | | | | | | |\n"; + String result = MovingRobot.printGrid(r1, r2); + + System.out.println(expected); + System.out.println(result); + + assertEquals(expected, result); + } } |
