Exemplo n.º 1
0
        private static void AssertClientEmail(MockEmail email, IOrganisation organisation, params ReportStatus[] statuses)
        {
            // Subject.

            email.AssertSubject(GetSubject(organisation));

            // Attachments.

            email.AssertAttachments(GetAttachments(organisation, statuses));

            // Contents.

            if (statuses.Any(a => a.Report is ResumeSearchActivityReport && !a.IsActivity))
            {
                email.AssertHtmlViewContains("your organisation has not performed any searches in the past month");
            }
            else
            {
                email.AssertHtmlViewContains("Please find attached the activity report for " + organisation.FullName);
            }
        }
Exemplo n.º 2
0
        private static void AssertAdministratorEmail(MockEmail email, ICommunicationUser administrator, IOrganisation organisation, params ReportStatus[] statuses)
        {
            email.AssertAddresses(Return, Return, administrator);

            // Subject.

            email.AssertSubject(GetAdministratorSubject(organisation, statuses));

            // Attachments.

            email.AssertAttachments(GetAttachments(organisation, statuses));

            // Contents.

            if (statuses.Any(s => s.IsActivity))
            {
                email.AssertHtmlViewContains("Please find attached the activity report for " + organisation.FullName);
            }
            else
            {
                if (statuses.Length == 1)
                {
                    if (statuses[0].Report is ResumeSearchActivityReport)
                    {
                        email.AssertHtmlViewContains("No resume search activity recorded for " + organisation.FullName);
                    }
                    else
                    {
                        email.AssertHtmlViewContains("No job board activity recorded for " + organisation.FullName);
                    }
                }
                else
                {
                    email.AssertHtmlViewContains("No job board activity and no resume search activity recorded for " + organisation.FullName);
                }
            }
        }
Exemplo n.º 3
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);
            }
        }