Пример #1
0
        private void CheckIfPrisonerIsAloneWithPassengers(IBoardingArea boardingArea)
        {
            var prisonerIsAlone = boardingArea.GetBoardingAreaManager().PrisonerIsPresent() &&
                                  !boardingArea.GetBoardingAreaManager().CoopIsPresent() &&
                                  boardingArea.GetBoardingAreaManager().CountPassengers() > 1;

            if (prisonerIsAlone)
            {
                AddError(ErrorMessages.PrisonerNotAloneWithPassengers);
            }
        }
Пример #2
0
        private void CheckIfFlightOfficerIsNotAloneWithCabinChief(IBoardingArea boardingArea)
        {
            var thereAreNotFlightOfficers = boardingArea.GetBoardingAreaManager().CountFlightOfficers() == 0;
            var thereAreMoreThanTwoPeople = boardingArea.GetBoardingAreaManager().CountPassengers() > 2;

            var FlightOfficersNotAlone = thereAreMoreThanTwoPeople || thereAreNotFlightOfficers ||
                                         !boardingArea.GetBoardingAreaManager().CabinChiefIsPresent();

            if (!FlightOfficersNotAlone)
            {
                AddError(ErrorMessages.FlightOfficersNotAloneWithCabinChief);
            }
        }
Пример #3
0
        private void CheckIfStewardessIsNotAloneWithPilot(IBoardingArea boardingArea)
        {
            var thereAreNotStewardess     = boardingArea.GetBoardingAreaManager().CountStewardesses() == 0;
            var thereAreMoreThanTwoPeople = boardingArea.GetBoardingAreaManager().CountPassengers() > 2;

            var stewardessIsAlone = thereAreMoreThanTwoPeople || thereAreNotStewardess ||
                                    !boardingArea.GetBoardingAreaManager().PilotIsPresent();

            if (!stewardessIsAlone)
            {
                AddError(ErrorMessages.StewardessesNotAloneWithPilot);
            }
        }
Пример #4
0
        public void GoToDepartureGate()
        {
            if (DriverIsNotPresent())
            {
                return;
            }

            _departurGate.GetBoardingAreaManager().AddPassengers(_boardingAreaManager.GetPassengers().ToList());
            _boardingAreaManager.RemoveAllPassengers();
        }
Пример #5
0
        public void GoToAirplane()
        {
            if (DriverIsNotPresent())
            {
                return;
            }

            if (_boardingAreaManager.CountPassengers() != 2)
            {
                return;
            }

            _airplane.GetBoardingAreaManager().AddPassengers(_boardingAreaManager.GetPassengers().ToList());
            _boardingAreaManager.RemoveAllPassengers();
        }
Пример #6
0
 public List <IPassenger> GetAirplanePassengers() =>
 _airplane.GetBoardingAreaManager().GetPassengers().ToList();
Пример #7
0
 public List <IPassenger> GetDeparturePassengers() =>
 _departureGate.GetBoardingAreaManager().GetPassengers().ToList();