another loop on longitude but moving backwards
This commit is contained in:
parent
c43bcd1aa6
commit
911358f2a2
|
@ -35,7 +35,7 @@ public class MarsRoverTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void loopTheWorldMovingForward() {
|
||||
public void loopTheWorldInLatitudeMovingForward() {
|
||||
Coordinates originalCoordinates = rover.getCurrentCoordinates();
|
||||
Direction originalDirection = rover.getCurrentDirection();
|
||||
|
||||
|
@ -47,9 +47,23 @@ public class MarsRoverTest {
|
|||
|
||||
@Test
|
||||
public void stepBackwards() {
|
||||
Direction originalDirection = rover.getCurrentDirection();
|
||||
|
||||
Coordinates currentPosition = rover.moveBackwards();
|
||||
|
||||
assertEquals(currentPosition, Coordinates.of(1, 3));
|
||||
assertEquals(rover.getCurrentDirection(), SOUTH);
|
||||
assertEquals(rover.getCurrentDirection(), originalDirection);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loopTheWorldInLatitudeMovingBackwards() {
|
||||
Coordinates originalCoordinates = rover.getCurrentCoordinates();
|
||||
Direction originalDirection = rover.getCurrentDirection();
|
||||
|
||||
repeatAction(10, i -> rover.moveBackwards());
|
||||
|
||||
assertEquals(rover.getCurrentCoordinates(), originalCoordinates);
|
||||
assertEquals(rover.getCurrentDirection(), originalDirection);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue