コード例 #1
0
 public void Mailbox_Test_Upsert()
 {
     EmailService service = new EmailService();
     var mailbox = GenerateMailboxEntity();
     var response = service.Upsert(mailbox);
     Assert.IsNotNull(response);
 }
コード例 #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);
 }
コード例 #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);
        }
コード例 #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);
            }
        }
コード例 #5
0
ファイル: EmailService.cs プロジェクト: ApiNetworks/iAFWeb
 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);
     }
 }
コード例 #6
0
ファイル: EmailController.cs プロジェクト: ApiNetworks/iAFWeb
 public EmailController()
 {
     emailService = new EmailService();
 }
コード例 #7
0
 public MailgunController()
 {
     emailService = new EmailService();
 }
コード例 #8
0
 public void Email_Test_GetEmails()
 {
     EmailService service = new EmailService();
     var output = service.GetEmails(0,10,0,null,null,null,null,"desc");
 }
コード例 #9
0
ファイル: EmailService.cs プロジェクト: ApiNetworks/iAFWeb
 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);
     }
 }