Esempio n. 1
0
 public void Mailbox_Test_Upsert()
 {
     EmailService service = new EmailService();
     var mailbox = GenerateMailboxEntity();
     var response = service.Upsert(mailbox);
     Assert.IsNotNull(response);
 }
Esempio n. 2
0
 public void Email_Test_GetInboxEmails()
 {
     string email = GetTestRecepientEmail().MD5();
     EmailService service = new EmailService();
     Dto<Email> emails = service.GetInboxEmails(email, 0, 10, 0);
     int count = emails.TotalRows;
     int serviceCount = service.CountInboxEmails(email, 0, 10, 0);
 }
Esempio n. 3
0
        public void Mailbox_Test_PopulateMailbox()
        {
            EmailService EmailService = new EmailService();
            var mailbox = GenerateMailboxEntity();
            var response = EmailService.Upsert(mailbox);

            EmailService emailService = new EmailService();
            for (int i = 0; i < 10; i++)
            {
                Email input = GenerateEmailEntity();
                Email output = emailService.Upsert(input);
                Assert.IsNotNull(output);
            }

            Assert.IsNotNull(response);
        }
Esempio n. 4
0
        public void Email_Test_UpsertData()
        {
            EmailService service = new EmailService();
            for (int i = 0; i < 5; i++)
            {
                Email input = GenerateEmailEntity();
                Email output = service.Upsert(input);
                Assert.IsNotNull(output);
            }

            for (int i = 0; i < 15; i++)
            {
                Email input = GenerateEmailEntity("*****@*****.**");
                Email output = service.Upsert(input);
                Assert.IsNotNull(output);
            }
        }
Esempio n. 5
0
 public Mailbox GetAll(int page = 0, int limit = 10, int skip = 0)
 {
     try
     {
         Mailbox mailbox = new Mailbox();
         mailbox.RecepientEmail = "*****@*****.**";
         if (mailbox != null)
         {
             EmailService emailService = new EmailService();
             var dto = emailService.GetEmails(page, limit, skip, null, null, null, null, "desc");
             if (dto != null && dto.Entities != null)
             {
                 mailbox.Emails = dto.Entities;
                 mailbox.TotalEmails = dto.TotalRows;
             }
         }
         return mailbox;
     }
     catch (Exception ex)
     {
         throw HandleException(new object[] { page, limit, skip }, ex);
     }
 }
Esempio n. 6
0
 public EmailController()
 {
     emailService = new EmailService();
 }
Esempio n. 7
0
 public MailgunController()
 {
     emailService = new EmailService();
 }
Esempio n. 8
0
 public void Email_Test_GetEmails()
 {
     EmailService service = new EmailService();
     var output = service.GetEmails(0,10,0,null,null,null,null,"desc");
 }
Esempio n. 9
0
 public Mailbox GetEmails(string id, int page = 0, int limit = 10, int skip = 0)
 {
     try
     {
         var mailbox = _mailboxRepository.Get(id);
         if (mailbox != null)
         {
             EmailService emailService = new EmailService();
             var dto = emailService.GetInboxEmails(id, page, limit, skip);
             if (dto != null && dto.Entities != null)
             {
                 mailbox.Emails = dto.Entities;
                 mailbox.TotalEmails = dto.TotalRows;
             }
         }
         return mailbox;
     }
     catch (Exception ex)
     {
         throw HandleException(new object[] { id }, ex);
     }
 }