public static bool SendEmail(EmailConfig config) { if (config == null) throw new ArgumentNullException("The parameter can not be null."); var validator = new EmailConfigValidator(); var result = validator.Validate(config); if (result.IsValid) throw new ArgumentException("Invalid email object."); return true; }
public void SetUp() { emailNull = null; emailEmpty = new EmailConfig(); emailFull = new EmailConfig() { From = "*****@*****.**", To = "*****@*****.**", Subject = "Test Email" }; }
public void TearDown() { emailNull = null; emailEmpty = null; emailFull = null; }