public void FindMostSuitableCheckIn_WhenBusyCheckIn_Test() { CheckIn checkIn = new CheckIn(); CheckIn checkIn2 = new CheckIn(); Baggage baggage = new Baggage(); Queue <Baggage> baggagesQueue = new Queue <Baggage>(); Queue <Baggage> baggagesQueue_True = new Queue <Baggage>(); List <Queue <Baggage> > baggagesQueueList = new List <Queue <Baggage> >(); checkIn.Status = BaggageStatus.Busy; checkIn2.Status = BaggageStatus.Busy; Procp_Form.Core.CheckInDispatcher dispatcher = new Procp_Form.Core.CheckInDispatcher(); List <CheckIn> checkIns = new List <CheckIn>(); checkIns.Add(checkIn); checkIns.Add(checkIn2); baggagesQueue.Enqueue(new Baggage()); baggagesQueue.Enqueue(new Baggage()); baggagesQueue_True.Enqueue(new Baggage()); dispatcher.checkinQueues.Add(baggagesQueue); dispatcher.checkinQueues.Add(baggagesQueue_True); dispatcher.checkins = checkIns; int a = dispatcher.FindMostSuitableCheckin(baggage); Assert.AreEqual(a, 1); }
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); }