public void TestExecute() { MemberSearchHost.ClearIndex(); // First candidate to find. IList <Member> members = new List <Member>(); Member member = _memberAccountsCommand.CreateTestMember(0); AddSalaryAndResume(member.Id); members.Add(member); // Create employer. var employer = _employerAccountsCommand.CreateTestEmployer(EmployerLoginId, _organisationsCommand.CreateTestOrganisation(0)); var jobPoster = new JobPoster { Id = employer.Id, SendSuggestedCandidates = true }; _jobPostersCommand.UpdateJobPoster(jobPoster); _allocationsCommand.CreateAllocation(new Allocation { OwnerId = employer.Id, CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, InitialQuantity = 1000 }); // Create a job that matches with the job poster as the contact. var jobAd = employer.CreateTestJobAd("Monkey boy"); jobAd.CreatedTime = DateTime.Now.AddDays(-1); jobAd.Description.Salary = null; _jobAdsCommand.PostJobAd(jobAd); // Execute. Execute(false); // Should get an email but for some reason that I can't quite figure out at the moment none is generated. // Will have to come back to it. //MockEmail email = SmtpServer.AssertEmailSent(); }
public void PushNotificationResumeSearchAlertsTaskTestsInitialize() { Resolve <IDbConnectionFactory>().DeleteAllTestData(); MemberSearchHost.ClearIndex(); _member = _memberAccountsCommand.CreateTestMember(MemberEmailAddress); _candidate = _candidatesCommand.GetCandidate(_member.Id); _resume = _candidateResumesCommand.AddTestResume(_candidate); _candidate.DesiredJobTitle = "mushroom picker"; _candidatesCommand.UpdateCandidate(_candidate); _employer = _employerAccountsCommand.CreateTestEmployer(EmployerLoginId, _organisationsCommand.CreateTestOrganisation(0)); _appleDevicesCommand.CreateDevice(new AppleDevice { OwnerId = _employer.Id, Active = true, DeviceToken = "b6080e7144f8ce3d53c67ac08416b51114cc1008fac1912b3879dd1d485e236a", }); var jobTitle = _resume.Jobs[0].Title; _search0 = CreateSearchAlert(_employer, 0, new MemberSearchCriteria { JobTitle = jobTitle, SortCriteria = new MemberSearchSortCriteria { SortOrder = MemberSortOrder.DateUpdated } }, AlertType.AppleDevice); _search1 = CreateSearchAlert(_employer, 1, new MemberSearchCriteria { JobTitle = jobTitle, SortCriteria = new MemberSearchSortCriteria { SortOrder = MemberSortOrder.DateUpdated } }, AlertType.Email); }
public void TestInitialize() { Resolve <IDbConnectionFactory>().DeleteAllTestData(); MemberSearchHost.ClearIndex(); }
protected void ClearSearchIndexes() { MemberSearchHost.ClearIndex(); JobAdSearchHost.ClearIndex(); JobAdSortHost.ClearIndex(); }