public SmtpHostSettingsProvider(IAppSettingsProvider appSettingsProvider)
        {
            if (appSettingsProvider == null)
            {
                throw new ArgumentNullException("appSettingsProvider");
            }

            string host = appSettingsProvider.GetSetting(SmtpHostKey);
            int port = int.Parse(appSettingsProvider.GetSetting(SmtpPortKey));
            string username = appSettingsProvider.GetSetting(SmtpUsernameKey);
            string password = appSettingsProvider.GetSetting(SmtpPasswordKey);
            smtpHostSettings = new SmtpHostSettings(host, port, username, password);
        }
Exemple #2
0
        public SmtpHostSettingsProvider(IAppSettingsProvider appSettingsProvider)
        {
            if (appSettingsProvider == null)
            {
                throw new ArgumentNullException("appSettingsProvider");
            }

            string host     = appSettingsProvider.GetSetting(SmtpHostKey);
            int    port     = int.Parse(appSettingsProvider.GetSetting(SmtpPortKey));
            string username = appSettingsProvider.GetSetting(SmtpUsernameKey);
            string password = appSettingsProvider.GetSetting(SmtpPasswordKey);

            smtpHostSettings = new SmtpHostSettings(host, port, username, password);
        }
 public void AllowNoUsernameToBeSet()
 {
     var hostSettings = new SmtpHostSettings("host");
     Assert.That(hostSettings.Username, Is.Null);
 }
 public void UseTheStandardSmtpPort_WhenNoPortIsSupplied()
 {
     var hostSettings = new SmtpHostSettings("host");
     Assert.That(hostSettings.Port, Is.EqualTo(SmtpHostSettings.DefaultSmtpPort));
 }
 public void AllowNoPasswordToBeSet()
 {
     var hostSettings = new SmtpHostSettings("host");
     Assert.That(hostSettings.Password, Is.Null);
 }