RED: test turning right from all directions
This commit is contained in:
parent
382262575d
commit
df3823e3a9
1 changed files with 26 additions and 0 deletions
|
|
@ -36,5 +36,31 @@ void main() {
|
||||||
expect(rover.direction, equals('N'));
|
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'));
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue