public MailingTest() { _sp = _host.Services; _mailer = _sp.GetService <IMailer>(); _emailsSent = _sp.GetService <MemorySender>(); }
public MailingTest() { _host = new MiruTestWebHost(MiruHost.CreateMiruHost(), services => { services .AddStorage() .AddMiruMvc() .AddMiruUrls() .AddLogging() .AddSerilogConfig() .AddSingleton <IUrlMaps, StubUrlMaps>() .AddMailing(options => { options.EmailDefaults(email => { email.From("*****@*****.**", "Mailing Test"); email.ReplyTo("*****@*****.**"); }); options.AppUrl = "http://www.contoso.com"; options.TemplatePath = new SolutionFinder().FromCurrentDir().Solution.AppTestsDir; }) .AddMiruTestFixture() .AddSenderMemory() .AddSingleton <MiruSolution, MiruTestSolution>() .AddQueuing((sp, cfg) => cfg.UseMemoryStorage()) .AddMediatR(typeof(MailingTest).Assembly); }); _sp = _host.Services; _mailer = _sp.GetService <IMailer>(); _emailsSent = _sp.GetService <MemorySender>(); _ = _sp.GetService <ITestFixture>(); }