@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); }
@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); }
@BeforeMethod public void setUp() throws Exception { Plateau.INSTANCE.setLength(5); Plateau.INSTANCE.setWidth(5); }