RED: test turning left from all directions
This commit is contained in:
parent
51073d9301
commit
630d366bbf
1 changed files with 26 additions and 0 deletions
|
|
@ -10,5 +10,31 @@ void main() {
|
||||||
expect(rover.y, equals(0));
|
expect(rover.y, equals(0));
|
||||||
expect(rover.direction, equals('N'));
|
expect(rover.direction, equals('N'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
group('Turning Left:', () {
|
||||||
|
test('from North faces West', () {
|
||||||
|
final rover = Rover(x: 0, y: 0, direction: 'N');
|
||||||
|
rover.turnLeft();
|
||||||
|
expect(rover.direction, equals('W'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('from West faces South', () {
|
||||||
|
final rover = Rover(x: 0, y: 0, direction: 'W');
|
||||||
|
rover.turnLeft();
|
||||||
|
expect(rover.direction, equals('S'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('from South faces East', () {
|
||||||
|
final rover = Rover(x: 0, y: 0, direction: 'S');
|
||||||
|
rover.turnLeft();
|
||||||
|
expect(rover.direction, equals('E'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('from East faces North', () {
|
||||||
|
final rover = Rover(x: 0, y: 0, direction: 'E');
|
||||||
|
rover.turnLeft();
|
||||||
|
expect(rover.direction, equals('N'));
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue