Exemple #1
0
 public EmailController(ILogger <EmailController> logger, IConfiguration configuration, EmailContext context)
 {
     _logger                 = logger;
     _configuration          = configuration;
     _templatesRepository    = new EmailTemplatesRepository(context);
     _emailRepository        = new MailKitRepository(configuration);
     _emailHistoryRepository = new EmailHistoryRepository(context);
 }
 public NotificationController()
 {
     _reminder     = new Reminder();
     _emailService = new GmailSMTPService();
     _reader       = new CSVReader();
     _formatter    = new TemplateFormatter();
     _repo         = new EmailHistoryRepository();
 }
Exemple #3
0
        public void MailNotSentForThisEntry()
        {
            EmailHistoryRepository manager = new EmailHistoryRepository();
            var contact = new EmailHistory()
            {
                LastEmailSent = DateTime.Today,
                ContactID     = "AB-3215"
            };

            Assert.IsTrue(!manager.IsMailSentToday(contact.ContactID));
        }
Exemple #4
0
        public void ShouldAddNew_MapEntires()
        {
            EmailHistoryRepository manager = new EmailHistoryRepository();

            manager.Add(new EmailHistory()
            {
                LastEmailSent = DateTime.Today,
                ContactID     = "K2001",
                Name          = "Kannapi"
            });
        }
Exemple #5
0
        public void ShouldRead_MapEntires()
        {
            EmailHistoryRepository manager = new EmailHistoryRepository();

            Assert.IsTrue(manager.Get().Count > 0);
        }