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