public void testDoorKeepsOpenedWhenOpeningIsRequested() { ElevatorController elevatorController = new ElevatorController(); Assert.IsTrue(elevatorController.isCabinDoorOpened()); elevatorController.openCabinDoor(); Assert.IsTrue(elevatorController.isCabinDoorOpened()); }
public void testDoorMustBeOpenedWhenCabinIsStoppedAndClosingDoors() { ElevatorController elevatorController = new ElevatorController(); elevatorController.goUpPushedFromFloor(1); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinStopped()); Assert.IsTrue(elevatorController.isCabinDoorClosing()); elevatorController.openCabinDoor(); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinStopped()); Assert.IsTrue(elevatorController.isCabinDoorOpening()); }
public void testCanNotOpenDoorWhenCabinIsMoving() { ElevatorController elevatorController = new ElevatorController(); elevatorController.goUpPushedFromFloor(1); elevatorController.cabinDoorClosed(); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinMoving()); Assert.IsTrue(elevatorController.isCabinDoorClosed()); elevatorController.openCabinDoor(); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinMoving()); Assert.IsTrue(elevatorController.isCabinDoorClosed()); }
public void testDoorKeepsOpeneingWhenItIsOpeneing() { ElevatorController elevatorController = new ElevatorController(); elevatorController.goUpPushedFromFloor(1); elevatorController.cabinDoorClosed(); elevatorController.cabinOnFloor(1); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinStopped()); Assert.IsTrue(elevatorController.isCabinDoorOpening()); elevatorController.openCabinDoor(); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinStopped()); Assert.IsTrue(elevatorController.isCabinDoorOpening()); }