예제 #1
0
        public void AddTest()
        {
            QueueService queueService = new QueueService();

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

            Assert.True(queueService.queuesSteps.ContainsKey("S1"));
        }
예제 #2
0
        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));
        }
예제 #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}");
     }
 }
예제 #4
0
        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));
        }
예제 #5
0
        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);
        }
예제 #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();
        }