@Test public void testPlanetExplorerMoveForwardTwiceAndTurnRightThenMoveForwardTwiceAgainFromLanding() { PlanetExplorer planetExplorer = new PlanetExplorer(100, 100, "", ""); String expectResult = planetExplorer.executeCommand("ffrff"); System.out.println(expectResult); assertEquals("(102,102,E)", expectResult); }
@Test public void testTheConamiCodeOrientationNorth() { PlanetExplorer pe = new PlanetExplorer(100, 100, ""); pe.executeCommand("up up down down left right left right b a - do the conami code"); String expected = "N"; String actual = pe.getOrientation(); assertEquals(expected, actual); }
@Test public void testPositionZeroAndOne() { PlanetExplorer pe = new PlanetExplorer(100, 100, ""); pe.executeCommand("rb"); int[] expected = new int[] {0, 1}; int[] actual = pe.getPositionXY(); assertArrayEquals(expected, actual); }
@Test public void testMoveRightExplorerOrientationEast() { PlanetExplorer pe = new PlanetExplorer(100, 100, ""); pe.executeCommand("r"); String expected = "E"; String actual = pe.getOrientation(); assertEquals(expected, actual); }
@Test public void testPlanetLanding() { PlanetExplorer planetExplorer = new PlanetExplorer(100, 100, "", ""); String expectResult = planetExplorer.executeCommand(""); assertEquals("(100,100,N)", expectResult); }