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)); }
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 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 static void AssertClientEmail(MockEmail email, ICommunicationUser administrator, IOrganisation organisation, params ReportStatus[] statuses) { email.AssertAddresses(administrator, Return, new EmailRecipient(ClientEmail, ClientFirstName.CombineLastName(ClientLastName), ClientFirstName, ClientLastName)); AssertClientEmail(email, organisation, statuses); }
private static void AssertSecondaryClientEmail(MockEmail email, ICommunicationUser administrator, IOrganisation organisation, params ReportStatus[] statuses) { email.AssertAddresses(administrator, Return, new EmailRecipient(SecondaryClientEmail)); AssertClientEmail(email, organisation, statuses); }
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)); }