Exemple #1
0
        public IHttpActionResult TravelToNextStop()
        {
            var lift        = HttpContext.Current.Application["Lift"];
            var liftService = new LiftService((Lift)lift);

            liftService.Travel();

            HttpContext.Current.Application["Lift"] = liftService.Lift;
            return(Ok());
        }
Exemple #2
0
        public void SingleTripFromCurrentLevelUp()
        {
            // suggested test case 1
            // Summons to ground, go to 5
            _liftService.RequestStop(new StopModel(0, DirectionEnum.Up));
            _liftService.Travel();
            _liftService.RequestStop(new StopModel(5, DirectionEnum.Any));
            _liftService.Travel();

            Assert.IsTrue(_liftService.Lift.CurrentLevel == 5 &&
                          _liftService.Lift.CurrentDirection == DirectionEnum.Any &&
                          _liftService.Lift.StopHistoryDisplay == "5",
                          _liftService.Lift.StopHistoryDisplay);
        }