Esempio n. 1
0
 @Test
 public void testToCreateARobotAndPlaceIt() {
   DIRECTIONS pos = DIRECTIONS.valueOf("NORTH");
   xy.setXY(0, 0);
   robot.place(pos, xy);
   assertEquals("0,0 NORTH", robot.report());
 }
Esempio n. 2
0
 @Test
 public void testTomoveRobotFacingEastAt00() {
   DIRECTIONS pos = DIRECTIONS.valueOf("EAST");
   xy.setXY(0, 0);
   robot.place(pos, xy);
   robot.move();
   assertEquals("1,0 EAST", robot.report());
 }
Esempio n. 3
0
 @Test
 public void testTomoveRobotFacingSouthAt00() {
   DIRECTIONS pos = DIRECTIONS.valueOf("SOUTH");
   xy.setXY(0, 0);
   robot.place(pos, xy);
   robot.move();
   assertEquals("0,-1 SOUTH", robot.report());
 }
Esempio n. 4
0
 @Test
 public void testToTurnLeftRobotFacingNorth() {
   DIRECTIONS pos = DIRECTIONS.valueOf("NORTH");
   xy.setXY(0, 0);
   robot.place(pos, xy);
   robot.turnLeft();
   assertEquals("0,0 WEST", robot.report());
 }
Esempio n. 5
0
 @Test
 public void testToTurnRobotFacingWestAndThenTurnRight() {
   DIRECTIONS pos = DIRECTIONS.valueOf("WEST");
   xy.setXY(0, 0);
   robot.place(pos, xy);
   robot.turnRight();
   assertEquals("0,0 NORTH", robot.report());
 }
Esempio n. 6
0
 @Test
 public void test_example_c() {
   robot.place(1, 2, DirectionKind.EAST);
   robot.move();
   robot.move();
   robot.left();
   robot.move();
   org.junit.Assert.assertEquals("3,3,NORTH", robot.report());
 }
Esempio n. 7
0
 @Test
 public void test_example_b() {
   robot.place(0, 0, DirectionKind.NORTH);
   robot.left();
   org.junit.Assert.assertEquals("0,0,WEST", robot.report());
 }
Esempio n. 8
0
 @Test
 public void test_example_a() {
   robot.place(0, 0, DirectionKind.NORTH);
   robot.move();
   org.junit.Assert.assertEquals("0,1,NORTH", robot.report());
 }