public void AddTest()
        {
            QueueService queueService = new QueueService();

            queueService.Add(new List <Relation>()
            {
                new Relation(1, "S1", FlightState.Departure)
            });

            Assert.True(queueService.queuesSteps.ContainsKey("S1"));
        }
        public void TryDeQueue_NegativeTest()
        {
            QueueService queueService = new QueueService();

            queueService.Add(new List <Relation>()
            {
                new Relation(1, "S1", FlightState.Departure),
            });

            Assert.False(queueService.TryDequeue("S1", out Plane plane));
        }
Esempio n. 3
0
 private void AddQueueItem(Watch watch, string filePath)
 {
     if (watch.Extentions.Contains(Path.GetExtension(filePath).Replace(".", string.Empty)))
     {
         logger.LogInformation($"WATCHER=> Queuing: {filePath}");
         _QueueService.Add(new MediaItem(watch, filePath));
     }
     else
     {
         logger.LogDebug($"WATCHER=> Skipping: {filePath}");
     }
 }
        public void TryDeQueue_PositiveTest()
        {
            QueueService queueService = new QueueService();

            queueService.Add(new List <Relation>()
            {
                new Relation(1, "S1", FlightState.Departure),
            });

            queueService.EnQueue("S1", new Plane("FR123", DateTime.Now, 3000, FlightState.Departure));

            Assert.True(queueService.TryDequeue("S1", out Plane plane));
        }
        public void EnQueueTest()
        {
            QueueService queueService = new QueueService();

            queueService.Add(new List <Relation>()
            {
                new Relation(1, "S1", FlightState.Departure),
            });

            queueService.EnQueue("S1", new Plane("FR123", DateTime.Now, 3000, FlightState.Departure));

            Assert.False(queueService.queuesSteps["S1"].IsEmpty);
        }
Esempio n. 6
0
        private static void SendMultipleNotificationsExample()
        {
            var ms = new S.MailSchema
            {
                Tomail = new List <string> {
                    "*****@*****.**"
                }
                , Priority = S.MailPriority.Low
                , Subject  = "Onderwerp"
                , Content  = "hierbij een linkje <a href='www.google.com'> veel plezier ermee"
            };

            // create queueService
            IQueueService service = new QueueService();

            service.Add("MailQueue", new MailNotifification(ms));
            service.Add("MailQueue", new MailNotifification("onderwerp", "inhoud", "*****@*****.**"));
            service.Add("klant1", new WebNotification("dit is een webbericht", "Type1"));

            // make broker to send multiple notifications
            IMessageBroker broker = new MessageBroker(service);

            broker.SendNotifications();
        }