コード例 #1
0
        public void SummonedFromBelow_OpensAtFloorSummonedFrom()
        {
            const int startingFloor = 10;
            var sut = new LiftController(startingFloor, this);

            const int floorSummonedFrom = 1;
            sut.Summon(floorSummonedFrom);
            TestHelpers.PassTime(sut, startingFloor, floorSummonedFrom);
            _stopsVisited.AssertThatLiftStopsAtFloor(floorSummonedFrom);
        }
コード例 #2
0
        public void SummonedFromAbove_OpensAtFloorSummonedFrom()
        {
            const int startingFloor = 1;
            var sut = new LiftController(startingFloor, this);

            const int floorSummonedFrom = 10;
            sut.Summon(floorSummonedFrom);
            TestHelpers.PassTime(sut, floorSummonedFrom, startingFloor);
            Assert.That(_stopsVisited.Contains(floorSummonedFrom), Is.True);
        }
コード例 #3
0
        public void SummonedTheRequestAnotherFloor_LiftVisitsBothFloors()
        {
            const int startingFloor = 1;
            var sut = new LiftController(startingFloor, this);

            const int floorSummonedFrom = 10;
            sut.Summon(floorSummonedFrom);

            TestHelpers.PassTime(sut, floorSummonedFrom, startingFloor);

            const int requestedFloor = startingFloor;
            sut.Request(requestedFloor);

            TestHelpers.PassTime(sut, floorSummonedFrom, requestedFloor);

            _stopsVisited.AssertThatLiftStopsAtFloor(new[] { floorSummonedFrom, requestedFloor });
        }