diff --git a/test/mars_rover_test.dart b/test/mars_rover_test.dart index 88cc2bd..ff67af3 100644 --- a/test/mars_rover_test.dart +++ b/test/mars_rover_test.dart @@ -36,5 +36,31 @@ void main() { expect(rover.direction, equals('N')); }); }); + + group('Turning Right:', () { + test('from North faces East', () { + final rover = Rover(x: 0, y: 0, direction: 'N'); + rover.turnRight(); + expect(rover.direction, equals('E')); + }); + + test('from East faces South', () { + final rover = Rover(x: 0, y: 0, direction: 'E'); + rover.turnRight(); + expect(rover.direction, equals('S')); + }); + + test('from South faces West', () { + final rover = Rover(x: 0, y: 0, direction: 'S'); + rover.turnRight(); + expect(rover.direction, equals('W')); + }); + + test('from West faces North', () { + final rover = Rover(x: 0, y: 0, direction: 'W'); + rover.turnRight(); + expect(rover.direction, equals('N')); + }); + }); }); }