예제 #1
0
        public void CheckElevator_IsOnline_AfterStart()
        {
            IElevator myElevator = new MyElevator(numberOfFloors: 3);

            myElevator.Start(initialFloor: 1);

            Assert.IsTrue(myElevator.IsOnline);
        }
        public void WhenLiftRequest_onMiddleFloor_withLiftOnMiddleFloor_opensDoor()
        {
            IElevator myElevator = new MyElevator(numberOfFloors: 3);

            myElevator.Start(initialFloor: 2);
            myElevator.RequestLift(floor: 2);

            Assert.IsTrue(myElevator.DoorsOpened);
        }
        public void WhenLiftRequest_onMiddleFloor_withLiftNotMiddleFloor_keepsDoorClosed()
        {
            IElevator myElevator = new MyElevator(numberOfFloors: 3);

            myElevator.Start(initialFloor: 1);
            myElevator.RequestLift(floor: 2);

            Assert.IsFalse(myElevator.DoorsOpened);
        }
예제 #4
0
        public void AfterRequestLift_ElevatorMoves_ToRequestFloor()
        {
            IElevator myElevator = new MyElevator(numberOfFloors: 3);

            myElevator.Start(initialFloor: 3);

            myElevator.RequestLift(floor: 1);

            Assert.IsTrue(myElevator.IsMoving);
        }
예제 #5
0
        public void InitializeElevator_withTwoFloors()
        {
            IElevator myElevator = new MyElevator(numberOfFloors: 2);

            Assert.AreEqual(2, myElevator.NumberOfFloors);
        }
예제 #6
0
        public void CheckElevator_IsOffline_BeforeStart()
        {
            IElevator myElevator = new MyElevator(numberOfFloors: 3);

            Assert.IsFalse(myElevator.IsOnline);
        }