Inheritance: IEmailQueueManager
Example #1
0
 public void Integration_Email_MWS_ProcessQueue_send_one_email()
 {
     // Arrange
     var cfg = ConfigurationManager.GetSection("MacheteWindowsService") as MacheteWindowsServiceConfiguration;
     var eServ = frb.ToServEmail();
     var em = new EmailQueueManager(eServ, frb.ToUOW());
     em.ProcessQueue(cfg.Instances[0].EmailQueue.EmailServer); // clear queue
     frb.AddEmail(status: Email.iReadyToSend);
     var mgr = new EmailQueueManager(eServ, frb.ToUOW());
     // Act
     mgr.ProcessQueue(cfg.Instances[0].EmailQueue.EmailServer);
     // Assert
     Assert.AreEqual(1, mgr.sentStack.Count);
     Assert.AreEqual(0, mgr.exceptionStack.Count);
 }
Example #2
0
 public void Integration_Email_MWS_ProcessQueue_send_one_email_with_attachent()
 {
     // Arrange
     var cfg = ConfigurationManager.GetSection("MacheteWindowsService") as MacheteWindowsServiceConfiguration;
     var eServ = frb.ToServEmail();
     var em = new EmailQueueManager(eServ, frb.ToUOW());
     em.ProcessQueue(cfg.Instances[0].EmailQueue.EmailServer); // clear queue
     frb.AddEmail(status: Email.iReadyToSend,
         attachment: frb.ValidAttachment,
         attachmentType: System.Net.Mime.MediaTypeNames.Text.Html);
     var mgr = new EmailQueueManager(eServ, frb.ToUOW());
     // Act
     mgr.ProcessQueue(cfg.Instances[0].EmailQueue.EmailServer);
     // Assert
     Assert.AreEqual(1, mgr.sentStack.Count);
     Assert.AreEqual(0, mgr.exceptionStack.Count);
 }