示例#1
0
 public MailServiceTests()
 {
     templateLocator = new ResourceLocator(GetType().Assembly);
     configuration = new Mock<IConfiguration>();
     configuration.SetupGet(m => m.Sender).Returns("*****@*****.**");
     configuration.SetupGet(m => m.SmtpHost).Returns("127.0.0.1");
 }
示例#2
0
 public IMailSender GetMailSender(IMailTemplateLocator templateLocator, IConfiguration configuration, string templatePath, IDictionary<string, object> data)
 {
     var sender = new MailSender { TemplateLocator = templateLocator, Configuration = configuration };
     sender.Initialize(templatePath, data);
     return sender;
 }
示例#3
0
 // ReSharper disable ParameterHidesMember
 public MailService RegisterTemplateLocator(IMailTemplateLocator templateLocator)
 {
     this.templateLocator = templateLocator;
     return this;
 }