Example #1
0
        public void testDoorKeepsOpenedWhenOpeningIsRequested()
        {
            ElevatorController elevatorController = new ElevatorController();

            Assert.IsTrue(elevatorController.isCabinDoorOpened());

            elevatorController.openCabinDoor();

            Assert.IsTrue(elevatorController.isCabinDoorOpened());
        }
Example #2
0
        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());
        }
Example #3
0
        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());
        }
Example #4
0
        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());
        }