Example #1
0
        protected void AssertEmail(MockEmail email, Employer employer, string subject, string body, string from, MockEmailAttachment[] attachments)
        {
            if (from == null)
            {
                email.AssertAddresses(Return, Return, employer);
            }
            else
            {
                email.AssertAddresses(Return, Return, new EmailRecipient(from, employer.FullName));
            }
            email.AssertSubject(subject);
            email.AssertHtmlViewContains(body);
            email.AssertHtmlViewDoesNotContain("<%= To.FirstName %>");
            email.AssertHtmlViewDoesNotContain("<%= To.LastName %>");

            if (attachments == null || attachments.Length == 0)
            {
                email.AssertNoAttachments();
            }
            else
            {
                email.AssertAttachments(attachments);
            }
        }