public void MailContextConstructorSetsUpObjectProperly() { var mail = new MailMessage("*****@*****.**", "*****@*****.**"); var context = new MailSendingContext(mail); Assert.Equal(mail, context.Mail); Assert.False(context.Cancel); }
public void MailContextConstructorSetsUpObjectProperly() { var mail = new SmtpMailAttributes {From = new MailAddress("*****@*****.**")}; mail.To.Add(new MailAddress("*****@*****.**")); var context = new MailSendingContext(mail); Assert.AreEqual(mail, context.Mail); Assert.False(context.Cancel); }
public void MailContextConstructorSetsUpObjectProperly() { var mail = new MailAttributes { From = new MailAddress("*****@*****.**") }; mail.To.Add(new MailAddress("*****@*****.**")); var context = new MailSendingContext(mail); Assert.AreEqual(mail, context.Mail); Assert.False(context.Cancel); }
/// <summary> /// This method is called before each mail is sent /// </summary> /// <param name="context"> /// A simple context containing the mail /// and a boolean value that can be toggled to prevent this /// mail from being sent. /// </param> protected virtual void OnMailSending(MailSendingContext context) { }
void IMailInterceptor.OnMailSending(MailSendingContext context) { OnMailSending(context); }