Ejemplo n.º 1
0
        public void Can_start_and_seed_with_backlog()
        {
            const int backlog = 500;

            var config = new DeliveryConfiguration {
                BacklogFolder = "backlog", MaxDegreeOfParallelism = 1
            };

            CreateOrCleanDirectory(config.BacklogFolder);

            var harness  = new InMemoryEmailService();
            var service  = new DeliveryService(harness, config);
            var messages = MessageFactory.EmailWithHtmlAndText(backlog);

            foreach (var message in messages)
            {
                service.Backlog(message);
            }

            service.Start();
            service.Stop(DeliveryCancellationHandling.EmptyQueue);
            Assert.AreEqual(backlog, harness.Messages.Count);

            CleanDirectory(config.BacklogFolder);
        }