Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }