Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 041754e1 authored by Sébastian Le Merdy's avatar Sébastian Le Merdy
Browse files

Merge remote-tracking branch 'smasset/master'

parents a9452801 5855e107
No related branches found
No related tags found
No related merge requests found
...@@ -147,13 +147,11 @@ public class BuildingTest { ...@@ -147,13 +147,11 @@ public class BuildingTest {
@Test @Test
public void should_throws_exception_if_elevator_goes_up_but_is_already_at_higher_floor() { public void should_throws_exception_if_elevator_goes_up_but_is_already_at_higher_floor() {
when(elevator.nextCommand()).thenReturn(UP, UP, UP, UP, UP, UP); when(elevator.nextCommand()).thenAnswer($ -> UP);
Building building = new Building(elevator, new ConstantMaxNumberOfUsers()); Building building = new Building(elevator, new ConstantMaxNumberOfUsers());
building.updateBuildingState(); for (int floor = 0; floor < ElevatorEngine.HIGHER_FLOOR; floor++) {
building.updateBuildingState(); building.updateBuildingState();
building.updateBuildingState(); }
building.updateBuildingState();
building.updateBuildingState();
expectedException.expect(ElevatorIsBrokenException.class); expectedException.expect(ElevatorIsBrokenException.class);
expectedException.expectMessage("can't go up because current floor is the highest floor"); expectedException.expectMessage("can't go up because current floor is the highest floor");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment