public void Can_Create_Subject_Without_CrLf() { var reportInfo = new ExceptionReportInfo(); reportInfo.SetExceptions(new[] { new Exception("hello\r\nagain") }); var mailSender = new MapiMailSender(reportInfo, null); Assert.That(mailSender.EmailSubject, Does.Not.Contain("\r")); Assert.That(mailSender.EmailSubject, Does.Not.Contain("\n")); }
public void Can_Create_Subject() { var exception = new Exception("hello"); var reportInfo = new ExceptionReportInfo { TitleText = "test" }; reportInfo.SetExceptions(new[] { exception }); var mailSender = new MapiMailSender(reportInfo, null); Assert.That(mailSender.EmailSubject, Is.EqualTo("hello")); }
public void Can_Use_Custom_Subject() { var exception = new Exception("Exception"); var reportInfo = new ExceptionReportInfo { TitleText = "test" }; reportInfo.SetExceptions(new[] { exception }); reportInfo.EmailReportSubject = "hello"; var mailSender = new MapiMailSender(reportInfo, null, new Mock <IScreenShooter>().Object); Assert.That(mailSender.EmailSubject, Is.EqualTo("hello")); }
public void Can_Create_Subject_If_Exception_Is_Null() { var mailSender = new MapiMailSender(new ExceptionReportInfo(), null); // no exceptions set, so message will be null, does mail cater for it? Assert.That(mailSender.EmailSubject, Is.EqualTo("Exception Report")); // reverts to a default message }