public static RnMailClient BuildRnMailClient( MailAccount mailAccount = null, IRnLogger logger = null, IWebConfig webConfig = null, IDirectory directory = null) { // ensure that we have a mail account to work with if (mailAccount == null) { mailAccount = new MailAccount { SmtpHost = "mail.goolge.com", SmtpPort = 443, Id = 1 }; } // ensure that we have all other required objects logger = logger ?? Substitute.For <IRnLogger>(); directory = directory ?? Substitute.For <IDirectory>(); // configure the default web.config reader if (webConfig == null) { webConfig = Substitute.For <IWebConfig>(); webConfig // override for default behavior .GetAppSetting(RnMailClient.DISK_MAIL_FOLDER, @"c:\mails\") .Returns(@"c:\mails\"); } return(new RnMailClient(logger, webConfig, mailAccount, directory)); }
// constructor public RnMailClient(IRnLogger logger, IWebConfig webConfig, MailAccount mailAccount, IDirectory directory = null) { _logger = logger; _webConfig = webConfig; _account = mailAccount; _directory = directory ?? new RnDirectory(); _mailClient = CreateMailClient(); }
public static UserAccountService BuildUserAccountService( IRnLogger logger = null, IUserAccountRepo userAccountRepo = null, IEncryptionService encryptionService = null) { logger = logger ?? Substitute.For <IRnLogger>(); userAccountRepo = userAccountRepo ?? Substitute.For <IUserAccountRepo>(); encryptionService = encryptionService ?? Substitute.For <IEncryptionService>(); return(new UserAccountService(logger, userAccountRepo, encryptionService)); }
public static MailAccountService BuildMailAccountService( IRnLogger logger = null, IMailAccountRepo mailAccountRepo = null, IEncryptionService encryptionService = null) { logger = logger ?? Substitute.For <IRnLogger>(); mailAccountRepo = mailAccountRepo ?? Substitute.For <IMailAccountRepo>(); encryptionService = encryptionService ?? Substitute.For <IEncryptionService>(); return(new MailAccountService(logger, mailAccountRepo, encryptionService)); }
public RnMailClientFactory(IRnLogger logger, IWebConfig webConfig, IDirectory directory) { _logger = logger; _webConfig = webConfig; _directory = directory; }
public UserAccountService(IRnLogger logger, IUserAccountRepo repo, IEncryptionService encryption) { _logger = logger; _repo = repo; _encryption = encryption; }
public MailAccountService(IRnLogger logger, IMailAccountRepo repo, IEncryptionService encryptionService) { _logger = logger; _repo = repo; _encryptionService = encryptionService; }