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); } } }
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)); }
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)); }
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); } }
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); } } }
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); }
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 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)); }