private void TestHasApplied(bool apply, bool search, bool?hasApplied) { var jobPoster = CreateJobPoster(); var jobAd1 = CreateJobAd(jobPoster, 1); var jobAd2 = CreateJobAd(jobPoster, 2); var member = CreateMember(); if (apply) { _internalApplicationsCommand.SubmitApplication(member, jobAd2, null); } // Search. var criteria = CreateCriteria(hasApplied); var execution = _executeJobAdSearchCommand.Search(search ? member : null, criteria, null); var expectedJobAdIds = (hasApplied == null || !search) ? new[] { jobAd1.Id, jobAd2.Id } : hasApplied.Value ? (apply ? new[] { jobAd2.Id } : new Guid[0]) : (apply ? new[] { jobAd1.Id } : new[] { jobAd1.Id, jobAd2.Id }); Assert.AreEqual(expectedJobAdIds.Length, execution.Results.TotalMatches); Assert.IsTrue(execution.Results.JobAdIds.CollectionEqual(expectedJobAdIds)); }
private void TestHasApplied(bool?hasApplied) { var employer = CreateEmployer(); var jobAd1 = PostJobAd(employer); var jobAd2 = PostJobAd(employer); var member = CreateMember(); _internalApplicationsCommand.SubmitApplication(member, jobAd2, null); // Search. var criteria = new JobAdSearchCriteria { AdTitle = BusinessAnalyst, HasApplied = hasApplied }; var search = new JobAdSearch { Criteria = criteria }; _jobAdSearchAlertsCommand.CreateJobAdSearchAlert(member.Id, search, DateTime.Now.AddDays(-6)); // Get the email. var email = ExecuteTask(); var expectedJobAds = hasApplied == null ? new[] { jobAd1, jobAd2 } : hasApplied.Value ? new[] { jobAd2 } : new[] { jobAd1 }; AssertJobAds(email, expectedJobAds); }
public void TestSubmitWithProfile() { var member = CreateMember(); AddResume(member.Id); // Submit. var employer = CreateEmployer(); var jobAd = CreateJobAd(employer); _internalApplicationsCommand.SubmitApplication(member, jobAd, null); // Check the email. var email = _emailServer.AssertEmailSent(); email.AssertAttachment(member.FullName + ".doc", "application/msword"); }