Exemple #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);
            }
        }
        private void AssertEmail(MockEmail email, string expectedSnippet, string expectedHeaderSnippet)
        {
            foreach (var snippet in _snippets)
            {
                if (snippet == expectedSnippet)
                {
                    email.AssertHtmlViewContains(snippet);
                }
                else
                {
                    email.AssertHtmlViewDoesNotContain(snippet);
                }
            }

            var links = email.GetHtmlView().GetLinks();

            AssertLink(links[0], expectedHeaderSnippet);
        }