From df3823e3a94af08cf18c99d550b6c8ca791b33d1 Mon Sep 17 00:00:00 2001 From: fiatcode Date: Tue, 24 Feb 2026 10:46:23 +0700 Subject: [PATCH] RED: test turning right from all directions --- test/mars_rover_test.dart | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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')); + }); + }); }); }