Beispiel #1
0
  @Test
  public void east_facing_increment_will_not_overflow() {
    Rover rover = new Rover(2, 0, RoverConstants.EAST);
    rover.execute("MMMMMM");

    int expectedX = Plateau.INSTANCE.getLength();
    int actualX = rover.getLocation().getXCoordinate();

    assertEquals(expectedX, actualX);
  }
Beispiel #2
0
  @Test
  public void north_facing_increment_will_not_overflow() {
    Rover rover = new Rover(0, 0, RoverConstants.NORTH);
    rover.execute("MMMMMM");

    int expectedY = Plateau.INSTANCE.getWidth();
    int actualY = rover.getLocation().getYCoordinate();

    assertEquals(expectedY, actualY);
  }
Beispiel #3
0
 @BeforeMethod
 public void setUp() throws Exception {
   Plateau.INSTANCE.setLength(5);
   Plateau.INSTANCE.setWidth(5);
 }