public void TestGetJobApplications() { var employer = CreateEmployer(1); var jobAd = _jobAdsCommand.PostTestJobAd(employer); var application = new InternalApplication { PositionId = jobAd.Id, ApplicantId = Guid.NewGuid(), CoverLetterText = "Cover letter" }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); application.CreatedTime = DateTime.Now.AddDays(-1); _applicationsCommand.UpdateApplication(application); application = new InternalApplication { PositionId = jobAd.Id, ApplicantId = Guid.NewGuid(), CoverLetterText = "Cover letter" }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); application.CreatedTime = DateTime.Now.AddDays(-1); _applicationsCommand.UpdateApplication(application); Assert.AreEqual(2, _jobAdReportsQuery.GetInternalApplications(DayRange.Yesterday)); }
public void TestSetStatus() { // Post job ad. var jobPoster = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0)); var integratorUser = _integrationCommand.CreateTestIntegratorUser(); var jobAd = PostJobAd(jobPoster, integratorUser); // Apply. var applicant = _memberAccountsCommand.CreateTestMember(0); var application = new InternalApplication { PositionId = jobAd.Id, ApplicantId = applicant.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); AssertStatus(application.Id, true, ApplicantStatus.New); // Set status. AssertSuccess(SetJobApplicationsStatus(integratorUser, application), 1, 0); AssertStatus(application.Id, false, ApplicantStatus.New); // Set status again. AssertSuccess(SetJobApplicationsStatus(integratorUser, application), 1, 0); AssertStatus(application.Id, false, ApplicantStatus.New); }
protected Member CreateNewCandidate(JobAdEntry jobAd, int index) { var member = CreateMember(index); var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); return(member); }
private void TestResults <T>(bool createReport, Func <Guid, IOrganisation> createOrganisation, Action <Administrator, IOrganisation, EmployerReport> test) where T : EmployerReport { var administrator = _administratorAccountsCommand.CreateTestAdministrator(1); var organisation = createOrganisation(administrator.Id); var employer = _employerAccountsCommand.CreateTestEmployer(1, organisation); var member = _memberAccountsCommand.CreateTestMember(1); if (typeof(T) == typeof(ResumeSearchActivityReport)) { _employerMemberViewsCommand.ViewMember(_app, employer, member); } else if (typeof(T) == typeof(JobBoardActivityReport)) { var jobAd = _jobAdsCommand.PostTestJobAd(employer); _jobAdViewsCommand.ViewJobAd(Guid.NewGuid(), jobAd.Id); var application = new InternalApplication { ApplicantId = Guid.NewGuid() }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); _jobAdsCommand.CloseJobAd(jobAd); } var report = _employerReportsCommand.CreateReportTemplate <T>(organisation.Id); if (createReport) { _employerReportsCommand.CreateReport(report); } test(administrator, organisation, report); }
private Guid Submit(Guid memberId, IJobAd jobAd, string coverLetterText, Action <InternalApplication> setApplication) { var application = CreateApplication(memberId, jobAd.Id, coverLetterText, setApplication); _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); return(application.Id); }
public void TestJob1Applicant() { var employer = CreateEmployer(); var jobAd = _jobAdsCommand.PostTestJobAd(employer); var member = _memberAccountsCommand.CreateTestMember(0); var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); LogIn(employer); AssertJobAds(jobAd.Id, 0, 1, 0); AssertJobAd(jobAd.Id, 0, 1, 0); }
protected void SubmitApplication(IMember member, JobAdEntry jobAd) { var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); }
private void Submit(Guid memberId, JobAdEntry jobAd) { var application = new InternalApplication { ApplicantId = memberId }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); }
public void TestJobAds() { var employer = CreateEmployer(0); var credit = _creditsQuery.GetCredit <ContactCredit>(); _allocationsCommand.CreateAllocation(new Allocation { CreditId = credit.Id, InitialQuantity = null, OwnerId = employer.Id }); var jobAdCredit = _creditsQuery.GetCredit <JobAdCredit>(); _allocationsCommand.CreateAllocation(new Allocation { CreditId = jobAdCredit.Id, InitialQuantity = null, OwnerId = employer.Id }); // Set up members which the employer can and cannot see and add them to the shortlist folder. var folder = _candidateFoldersQuery.GetShortlistFolder(employer); var blockList = _candidateBlockListsQuery.GetPermanentBlockList(employer); // Folder. var member = _memberAccountsCommand.CreateTestMember(0); for (var index = 1; index < 50; ++index) { member = _memberAccountsCommand.CreateTestMember(index); var candidate = _candidatesQuery.GetCandidate(member.Id); _candidateResumesCommand.AddTestResume(candidate); _employerMemberViewsCommand.AccessMember(_app, employer, _employerMemberViewsQuery.GetProfessionalView(employer, member), MemberAccessReason.Unlock); if (index <= 45) { _candidateListsCommand.AddCandidateToFolder(employer, folder, member.Id); } else { _candidateListsCommand.AddCandidateToBlockList(employer, blockList, member.Id); } } // Add some jobs. var jobAd = _jobAdsCommand.PostTestJobAd(employer, JobAdStatus.Open); for (var i = 0; i < 6; i++) { _jobAdsCommand.PostTestJobAd(employer, JobAdStatus.Open); _jobAdsCommand.PostTestJobAd(employer, JobAdStatus.Closed); } var application = new InternalApplication { ApplicantId = member.Id, PositionId = jobAd.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); }
protected Application ApplyForInternalJob(JobAdEntry jobAd, Guid applicantId) { var application = new InternalApplication { ApplicantId = applicantId }; _jobAdsApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdsApplicationSubmissionsCommand.SubmitApplication(jobAd, application); return(application); }
public void TestFilterHasApplied() { var employer = CreateEmployer(0); var jobAd1 = _jobAdsCommand.PostTestJobAd(employer); var jobAd2 = _jobAdsCommand.PostTestJobAd(employer); var member = _membersCommand.CreateTestMember(1); // Member has applied for jobAd1. var application = new InternalApplication { PositionId = jobAd1.Id, ApplicantId = member.Id, CoverLetterText = "Cover letter" }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd1, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd1, application); // Filter. TestFilter(member, CreateHasAppliedQuery, new[] { jobAd1.Id, jobAd2.Id }, new[] { jobAd1.Id }, new[] { jobAd2.Id }); }
public void TestGetJobApplication() { // Post job ad. var jobPoster = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0)); var integratorUser = _integrationCommand.CreateTestIntegratorUser(); var jobAd = PostJobAd(jobPoster, integratorUser); // Apply. var applicant = _memberAccountsCommand.CreateTestMember(0); var application = new InternalApplication { PositionId = jobAd.Id, ApplicantId = applicant.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); // Get the application. AssertSuccess(GetJobApplication(integratorUser, application.Id), applicant, null, null); }
private ActionResult SendApplication(JobAdQuestionsModel model, IEnumerable <ApplicationAnswer> answers) { _sendApplicationsCommand.SendApplication(model.Application, answers); _jobAdApplicationSubmissionsCommand.SubmitApplication(model.JobAd, model.Application); // If there is no external url then redirect straight to the applied page. if (string.IsNullOrEmpty(model.JobAd.Integration.ExternalApplyUrl)) { return(RedirectToRoute(JobAdsRoutes.JobAdApplied, new { jobAdId = model.JobAd.Id })); } return(RedirectToUrl(GetExternalApplyUrl(model.JobAd.Integration.ExternalApplyUrl, model.Member != null ? (ICommunicationUser)model.Member : model.AnonymousContact))); }
private IList <Member> CreateNewCandidates(int count, JobAdEntry jobAd) { var members = new List <Member>(); for (var index = 0; index < count; ++index) { var member = CreateMember(index); var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); members.Add(member); } return(members); }
public void TestFilterHasApplied() { var employer = CreateEmployer(1); var jobAd1 = CreateJobAd(employer); var jobAd2 = CreateJobAd(employer); var member = CreateMember(0); var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd1, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd1, application); // Filter. TestFilter(member, CreateHasAppliedCriteria, new[] { jobAd1.Id, jobAd2.Id }, new[] { jobAd1.Id }, new[] { jobAd2.Id }); }
Guid IInternalApplicationsCommand.Submit(AnonymousContact contact, IJobAd jobAd, Guid fileReferenceId) { // Check that the job hasn't already been applied for. if (_jobAdApplicationSubmissionsQuery.HasSubmittedApplication(contact.Id, jobAd.Id)) { throw new AlreadyAppliedException(); } // Create the application. var application = new InternalApplication { PositionId = jobAd.Id, ApplicantId = contact.Id, ResumeFileId = fileReferenceId, }; // Submit it. _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); return(application.Id); }
public void TestHasApplied() { var member = CreateMember(0); var jobAd = CreateJobAd(); var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); LogIn(member); Search(Keywords); var node = GetResult(jobAd.Id); Assert.IsNotNull(node.SelectSingleNode(".//div[@class='icon applied active']")); Assert.IsNull(node.SelectSingleNode(".//div[@class='icon applied ']")); var model = ApiSearch(Keywords); Assert.AreEqual(1, model.JobAds.Count); Assert.IsTrue(model.JobAds[0].HasApplied); }
public void TestOverrideParseWithApplication() { var member = CreateMember(0); var candidate = _candidatesQuery.GetCandidate(member.Id); _candidateResumesCommand.AddTestResume(candidate); // Confirm resume. candidate = _candidatesQuery.GetCandidate(member.Id); Assert.IsNotNull(candidate.ResumeId); var resume1 = _resumesQuery.GetResume(candidate.ResumeId.Value); Assert.IsNotNull(resume1); Assert.AreEqual(0, _candidateResumeFilesQuery.GetResumeFiles(member.Id).Count); Assert.IsNull(_candidateResumeFilesQuery.GetResumeFile(resume1.Id)); // Apply for job ad with that resume. var employer = CreateEmployer(); var jobAd = _jobAdsCommand.PostTestJobAd(employer); var application = new InternalApplication { ApplicantId = member.Id, ResumeId = resume1.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); LogIn(member); // Upload and parse. var fileReferenceId1 = Upload(TestResume.Complete, "Resume.doc"); AssertJsonSuccess(Parse(fileReferenceId1)); // Confirm resume. candidate = _candidatesQuery.GetCandidate(member.Id); Assert.IsNotNull(candidate.ResumeId); var resume2 = _resumesQuery.GetResume(candidate.ResumeId.Value); Assert.IsNotNull(resume2); Assert.AreEqual(resume1.Id, resume2.Id); // Show that the resume is associated with the uploaded file. var references = _candidateResumeFilesQuery.GetResumeFiles(member.Id); Assert.AreEqual(1, references.Count); var resumeFileReference1 = references[0]; var resumeFileReference2 = _candidateResumeFilesQuery.GetResumeFile(member.Id, fileReferenceId1); var resumeFileReference3 = _candidateResumeFilesQuery.GetResumeFile(resume2.Id); Assert.AreEqual(fileReferenceId1, resumeFileReference1.FileReferenceId); Assert.AreEqual(fileReferenceId1, resumeFileReference2.FileReferenceId); Assert.AreEqual(fileReferenceId1, resumeFileReference3.FileReferenceId); Assert.AreEqual(resumeFileReference1.Id, resumeFileReference2.Id); Assert.AreEqual(resumeFileReference1.Id, resumeFileReference3.Id); // Upload and parse another resume. var fileReferenceId2 = Upload(TestResume.NoPhoneNumber, "Resume.doc"); AssertJsonSuccess(Parse(fileReferenceId2)); // Confirm resume. candidate = _candidatesQuery.GetCandidate(member.Id); Assert.IsNotNull(candidate.ResumeId); var resume3 = _resumesQuery.GetResume(candidate.ResumeId.Value); Assert.IsNotNull(resume3); Assert.AreEqual(resume1.Id, resume2.Id); Assert.AreEqual(resume1.Id, resume3.Id); // Show that the resume is associated with the new uploaded file. references = _candidateResumeFilesQuery.GetResumeFiles(member.Id); Assert.AreEqual(2, references.Count); resumeFileReference1 = (from r in references where r.FileReferenceId == fileReferenceId1 select r).Single(); resumeFileReference2 = (from r in references where r.FileReferenceId == fileReferenceId2 select r).Single(); resumeFileReference3 = _candidateResumeFilesQuery.GetResumeFile(member.Id, fileReferenceId1); var resumeFileReference4 = _candidateResumeFilesQuery.GetResumeFile(member.Id, fileReferenceId2); var resumeFileReference5 = _candidateResumeFilesQuery.GetResumeFile(resume3.Id); Assert.AreEqual(fileReferenceId1, resumeFileReference1.FileReferenceId); Assert.AreEqual(fileReferenceId2, resumeFileReference2.FileReferenceId); Assert.AreEqual(fileReferenceId1, resumeFileReference3.FileReferenceId); Assert.AreEqual(fileReferenceId2, resumeFileReference4.FileReferenceId); Assert.AreEqual(fileReferenceId2, resumeFileReference5.FileReferenceId); Assert.AreEqual(resumeFileReference1.Id, resumeFileReference3.Id); Assert.AreEqual(resumeFileReference2.Id, resumeFileReference4.Id); Assert.AreEqual(resumeFileReference2.Id, resumeFileReference5.Id); }