Exemple #1
0
        public void FindMostSuitableCheckIn_WhenFreeCheckIn_Test()
        {
            CheckIn checkIn  = new CheckIn();
            CheckIn checkIn2 = new CheckIn();

            checkIn.Status  = BaggageStatus.Busy;
            checkIn2.Status = BaggageStatus.Free;

            Procp_Form.Core.CheckInDispatcher dispatcher = new Procp_Form.Core.CheckInDispatcher();

            List <CheckIn>  checkIns  = new List <CheckIn>();
            Baggage         baggage   = new Baggage();
            Queue <Baggage> baggagesQ = new Queue <Baggage>();

            baggagesQ.Enqueue(baggage);
            List <Queue <Baggage> > baggages = new List <Queue <Baggage> >()
            {
                baggagesQ,
                new Queue <Baggage>(),
            };

            checkIns.Add(checkIn);
            checkIns.Add(checkIn2);

            dispatcher.SetupCheckins(checkIns);

            int a = dispatcher.FindMostSuitableCheckin(baggage);

            Assert.AreEqual(a, 1);
        }
Exemple #2
0
        public void SetupCheckIns_SetupQueues_Test()
        {
            List <CheckIn> checkInList = new List <CheckIn>()
            {
                new CheckIn(), new CheckIn(),
            };

            Procp_Form.Core.CheckInDispatcher checkInDispatcher = new Procp_Form.Core.CheckInDispatcher();

            checkInDispatcher.SetupCheckins(checkInList);

            //test if the check-ins are added correctly
            Assert.AreEqual(2, checkInDispatcher.GetCheckIns().Count);
            //test if the queued baggages are added correctly
            Assert.AreEqual(2, checkInDispatcher.GetQueuedBaggage().Count);
        }