Skip to content

Commit d0d134b

Browse files
committed
Feedback on the rover turn naming
1 parent 1db3b79 commit d0d134b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/com/thoughtworks/rover/MarsRover.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public String currentLocation() {
3232
return currentCoordinates.toString() + " " + currentDirection.toString();
3333
}
3434

35-
public void rotateRight() {
35+
public void turnRight() {
3636
this.currentDirection = this.currentDirection.right();
3737
}
3838

39-
public void rotateLeft() {
39+
public void turnLeft() {
4040
this.currentDirection = this.currentDirection.left();
4141
}
4242

src/com/thoughtworks/rover/commands/RotateLeftCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class RotateLeftCommand implements ICommand {
66

77
@Override
88
public void execute(final MarsRover rover) {
9-
rover.rotateLeft();
9+
rover.turnLeft();
1010
}
1111

1212
}

src/com/thoughtworks/rover/commands/RotateRightCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class RotateRightCommand implements ICommand {
66

77
@Override
88
public void execute(final MarsRover rover) {
9-
rover.rotateRight();
9+
rover.turnRight();
1010
}
1111

1212
}

test/MarsRoverTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void canRotateLeft() {
1515
MarsRover marsRover = new MarsRover(plateau, Direction.N, startingPosition);
1616

1717
//When
18-
marsRover.rotateLeft();
18+
marsRover.turnLeft();
1919

2020
//then
2121
Assert.assertEquals("1 2 W", marsRover.currentLocation());
@@ -29,7 +29,7 @@ public void canRotateRight() {
2929
MarsRover marsRover = new MarsRover(plateau, Direction.N, startingPosition);
3030

3131
//When
32-
marsRover.rotateRight();
32+
marsRover.turnRight();
3333

3434
//then
3535
Assert.assertEquals("1 2 E", marsRover.currentLocation());

0 commit comments

Comments
 (0)