Inheritance: IEmailSender
Exemplo n.º 1
0
        public void Setup()
        {
            _sender = new TestEmailSender();
            var outgouingQueue = new TransientQueue();
            var mailingListBroker = new TestMailingListBroker().Register<string>("*****@*****.**", "*****@*****.**");
            var templateEngine = new MailTemplateEngine();
            templateEngine.Register<string>(m => new MailView(string.Format("Subject for {0}", m),
                                                               string.Format("Body for {0}!", m)));

            _notifier = new MailNotifier("*****@*****.**", outgouingQueue, mailingListBroker, templateEngine, _sender);
        }
Exemplo n.º 2
0
        public void Setup()
        {
            _sender = new TestEmailSender();
            var outgouingQueue = new PersistentQueue(Guid.NewGuid().ToString("n"));
            var mailingListBroker = new MailingListBroker(new[]
            {
                new MailingRule("*", new MailingList("alice@localhost"))
            });
            var templateEngine = new RazorMailTemplateEngine(new RazorTemplatesFactory("Resources"), true);

            _notifier = new MailNotifier(
                "me@localhost",
                outgouingQueue,
                mailingListBroker,
                templateEngine,
                _sender);
        }