示例#1
0
        protected static void AssertTitles(MockEmail email, IList <string> locations, int totalMatches, bool checkEachLocation)
        {
            if (totalMatches == 1)
            {
                email.AssertHtmlViewContains("<strong>1 new job</strong>");
            }
            else
            {
                email.AssertHtmlViewContains("<strong>" + totalMatches + " new jobs</strong>");
            }

            if (locations.Count != totalMatches)
            {
                var check = "top " + locations.Count + " out of total";
                email.AssertHtmlViewContains(check);
            }

            if (checkEachLocation)
            {
                foreach (var location in locations)
                {
                    email.AssertHtmlViewContains(location);
                }
            }
        }
示例#2
0
 private static void AssertEmail(MockEmail email, ICommunicationUser employer, int newCandidates)
 {
     email.AssertAddresses(Return, Return, employer);
     email.AssertSubject(GetSubject(newCandidates));
     email.AssertHtmlViewContains(employer.FirstName);
     email.AssertHtmlViewContains(GetBodySnippet(newCandidates));
 }
示例#3
0
        private void AssertEmail(IEmployer employer, IList <Member> members, MockEmail email)
        {
            email.AssertSubject("Job candidates from LinkMe");
            email.AssertHtmlViewContains("4 suggested candidates");
            var view = _employerMemberViewsQuery.GetEmployerMemberView(employer, members[0]);

            email.AssertHtmlViewContains(view.GetDisplayText(false));
        }
示例#4
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);
            }
        }
示例#5
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);
                }
            }
        }
示例#6
0
        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);
        }
示例#7
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);
            }
        }
示例#8
0
 private static void AssertEmail <TCredit>(ICommunicationUser expected, MockEmail email, int?quantity)
 {
     email.AssertAddresses(Return, Return, expected);
     email.AssertSubject(GetSubject <TCredit>(quantity));
     email.AssertHtmlViewContains(GetBodySnippet <TCredit>(quantity));
 }