public void WhenGettingEmailLogEntryByIdEmailLogIsReturned() { _emailLogService = new EmailLogService(); // TODO: Initialize to an appropriate value var application = _applicationService.AddApplication("Test", "http://www.test.com", true); var id = Guid.NewGuid(); var expected = _emailLogService.AddEmailLog(id, "*****@*****.**", "*****@*****.**", "Test Email", "Welcome to PaidThx", System.DateTime.Now); var actual = _emailLogService.GetEmailLog(id); Assert.AreEqual(expected, actual); }
public void WhenAddingToEmailLogEmalLogIsAdded() { _emailLogService = new EmailLogService(_ctx); _applicationService = new ApplicationService(_ctx); var application = _applicationService.AddApplication("Test", "http://www.test.com", true); string fromAddress = "*****@*****.**"; string toAddress = "*****@*****.**"; string subject = "Test Email"; string body = "Welcome to PaidThx"; Nullable <DateTime> sentDate = System.DateTime.Now; EmailLog expected = _emailLogService.AddEmailLog(application.ApiKey, fromAddress, toAddress, subject, body, sentDate); EmailLog actual = _ctx.EmailLog.ElementAt(0); Assert.AreEqual(expected, actual); }
public void WhenAddingToEmailLogEmalLogIsAdded() { _emailLogService = new EmailLogService(_ctx); _applicationService = new ApplicationService(_ctx); var application = _applicationService.AddApplication("Test", "http://www.test.com", true); string fromAddress = "*****@*****.**"; string toAddress = "*****@*****.**"; string subject = "Test Email"; string body = "Welcome to PaidThx"; Nullable<DateTime> sentDate = System.DateTime.Now; EmailLog expected = _emailLogService.AddEmailLog(application.ApiKey, fromAddress, toAddress, subject, body, sentDate); EmailLog actual = _ctx.EmailLog.ElementAt(0); Assert.AreEqual(expected, actual); }
static void Main(string[] args) { //國泰對帳 if (Enable_QueryPayMessage) { var orderService = new OrderService(); Console.WriteLine("QueryPayMessage"); orderService.QueryPayMessage(); } //Email檢查 if (Enable_SendEmail) { var emailBoxServie = new EmailLogService(); Console.WriteLine("SendEmail"); emailBoxServie.SendEmailDelay(); } Console.WriteLine("--------Done--------"); Console.ReadKey(); }
public void WhenUpdatingEmailLogThenEmailLogIsUpdated() { _emailLogService = new EmailLogService(_ctx); var application = _applicationService.AddApplication("Test", "http://www.test.com", true); var id = Guid.NewGuid(); string fromAddress = "*****@*****.**"; string toAddress = "*****@*****.**"; string subject = "Test Email"; string body = "Welcome to PaidThx"; Nullable <DateTime> sentDate = System.DateTime.Now; var emailLog = _emailLogService.AddEmailLog(application.ApiKey, fromAddress, toAddress, subject, body, sentDate); emailLog.EmailStatus = EmailStatus.Sent; _emailLogService.UpdateEmailLog(emailLog); EmailLog expected = emailLog; EmailLog actual = _ctx.EmailLog.ElementAt(0); Assert.AreEqual(expected, actual); }
public void WhenUpdatingEmailLogThenEmailLogIsUpdated() { _emailLogService = new EmailLogService(_ctx); var application = _applicationService.AddApplication("Test", "http://www.test.com", true); var id = Guid.NewGuid(); string fromAddress = "*****@*****.**"; string toAddress = "*****@*****.**"; string subject = "Test Email"; string body = "Welcome to PaidThx"; Nullable<DateTime> sentDate = System.DateTime.Now; var emailLog = _emailLogService.AddEmailLog(application.ApiKey, fromAddress, toAddress, subject, body, sentDate); emailLog.EmailStatus = EmailStatus.Sent; _emailLogService.UpdateEmailLog(emailLog); EmailLog expected = emailLog; EmailLog actual = _ctx.EmailLog.ElementAt(0); Assert.AreEqual(expected, actual); }