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 testCabinDoorStartsClosingWhenElevatorGetsCalled() { ElevatorController elevatorController = new ElevatorController(); elevatorController.goUpPushedFromFloor(1); Assert.IsFalse(elevatorController.isIdle()); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinStopped()); Assert.IsFalse(elevatorController.isCabinMoving()); Assert.IsFalse(elevatorController.isCabinDoorOpened()); Assert.IsFalse(elevatorController.isCabinDoorOpening()); Assert.IsTrue(elevatorController.isCabinDoorClosing()); Assert.IsFalse(elevatorController.isCabinDoorClosed()); }
public void testCabinStopsAndStartsOpeningDoorWhenGetsToDestination() { ElevatorController elevatorController = new ElevatorController(); elevatorController.goUpPushedFromFloor(1); elevatorController.cabinDoorClosed(); elevatorController.cabinOnFloor(1); Assert.IsFalse(elevatorController.isIdle()); Assert.IsTrue(elevatorController.isWorking()); Assert.IsTrue(elevatorController.isCabinStopped()); Assert.IsFalse(elevatorController.isCabinMoving()); Assert.IsFalse(elevatorController.isCabinDoorOpened()); Assert.IsTrue(elevatorController.isCabinDoorOpening()); Assert.IsFalse(elevatorController.isCabinDoorClosing()); Assert.IsFalse(elevatorController.isCabinDoorClosed()); Assert.AreEqual(1, elevatorController.cabinFloorNumber()); }