public void TestCareerOneJobAdNotReturned() { // Create a "normal" job ad and make sure it's returned var careerOneJobAd = _employer.CreateTestJobAd(); careerOneJobAd.Status = JobAdStatus.Open; careerOneJobAd.JobDescription.Industries.Clear(); careerOneJobAd.JobDescription.Industries.Add(Container.Current.Resolve <IIndustriesCommand>().GetIndustries()[1]); _jobAdsCommand.PostJobAd(careerOneJobAd); string response = CallService(GetJobAds.IndustriesParameter, ((Industry)careerOneJobAd.JobDescription.Industries[0]).Name); var netJobAd = GetJobAdFeedFromResponse(response); AssertNotNull(netJobAd); AssertEquals(careerOneJobAd.Id, netJobAd.Id); // Now make it a CareerOne job ad and make sure it's no longer returned. careerOneJobAd.IntegratorUserId = _integrationCommand.CreateTestIntegratorUser(IntegrationHelper.CareerOneIntegratorUsername, "password", IntegratorPermissions.None).Id; _jobAdsCommand.UpdateJobAd(careerOneJobAd); response = CallService(GetJobAds.IndustriesParameter, ((Industry)careerOneJobAd.JobDescription.Industries[0]).Name); netJobAd = GetJobAdFeedFromResponse(response); AssertNull(netJobAd); }
public void TestIndustrySegments() { var employer = new Employer(); var jobAd = employer.CreateTestJobAd(); // No industries. jobAd.Description.Industries = null; var path = jobAd.GetJobRelativePath(); AssertSegmentLength(path); AssertIndustrySegment(path, "-"); // Add an industry. jobAd.Description.Industries = new List <Industry>(); var industry = _industriesQuery.GetIndustries()[0]; jobAd.Description.Industries.Add(industry); path = jobAd.GetJobRelativePath(); AssertSegmentLength(path); AssertIndustrySegment(path, industry.UrlName); // Set a different industry. jobAd.Description.Industries = new List <Industry>(); industry = _industriesQuery.GetIndustries()[1]; jobAd.Description.Industries.Add(industry); path = jobAd.GetJobRelativePath(); AssertSegmentLength(path); AssertIndustrySegment(path, industry.UrlName); // Set 2 industries. jobAd.Description.Industries = new List <Industry>(); industry = _industriesQuery.GetIndustries()[0]; jobAd.Description.Industries.Add(industry); industry = _industriesQuery.GetIndustries()[1]; jobAd.Description.Industries.Add(industry); path = jobAd.GetJobRelativePath(); AssertSegmentLength(path); AssertIndustrySegment(path, "-"); // Add all industries. jobAd.Description.Industries = new List <Industry>(); foreach (var allIndustry in _industriesQuery.GetIndustries()) { jobAd.Description.Industries.Add(allIndustry); } path = jobAd.GetJobRelativePath(); AssertSegmentLength(path); AssertIndustrySegment(path, "-"); }
protected override void SetUp() { base.SetUp(); ClearSearchIndexes(); _integratorUser = _integrationCommand.CreateTestIntegratorUser(); const string testUserId = "employer"; _employer = _employersCommand.CreateTestEmployer(testUserId, _organisationsCommand.CreateTestOrganisation(0)); _jobAd = _employer.CreateTestJobAd(); _jobAd.JobDescription.Summary = "Summary"; _jobAd.Status = JobAdStatus.Open; _jobAd.JobDescription.Industries.Clear(); _jobAd.JobDescription.Industries.Add(Container.Current.Resolve <IIndustriesCommand>().GetIndustries()[0]); _jobAdsCommand.PostJobAd(_jobAd); }
protected Member PreLoadTestUserProfiles(bool admin, bool createEmployer, bool link, bool inviters, bool fullSetOfNetworkers, bool jobs, bool references, bool resumeRequests) { #region set up 10 networkers Member five = null; Member six = null; Member member = _memberAccountsCommand.CreateTestMember(TestNetworkerUserId, "password", "Homer", "Simpson"); var candidate = _candidatesCommand.GetCandidate(member.Id); _candidateResumesCommand.AddTestResume(candidate); Member two = _memberAccountsCommand.CreateTestMember(TestUserTwoId, "password", "Two First", "Two Last"); Member three = _memberAccountsCommand.CreateTestMember(TestUserThreeId, "password", "Three First", "Three Last"); Member four = _memberAccountsCommand.CreateTestMember(TestUserFourId); if (fullSetOfNetworkers) { five = _memberAccountsCommand.CreateTestMember(TestUserFiveId); six = _memberAccountsCommand.CreateTestMember(TestUserSixId); _memberAccountsCommand.CreateTestMember(TestUserSevenId); _memberAccountsCommand.CreateTestMember(TestUserEightId); _memberAccountsCommand.CreateTestMember(TestUserNineId); } #endregion #region set up an employer and a job ad if (createEmployer) { Employer employer = _employerAccountsCommand.CreateTestEmployer(TestEmployerUserId, _organisationsCommand.CreateTestOrganisation("LinkMe Pty Ltd")); _allocationsCommand.CreateAllocation(new Allocation { OwnerId = employer.Id, CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, InitialQuantity = 1000 }); _allocationsCommand.CreateAllocation(new Allocation { OwnerId = employer.Id, CreditId = _creditsQuery.GetCredit <JobAdCredit>().Id, InitialQuantity = 1000 }); var ja = employer.CreateTestJobAd("test job", "lol test job"); _jobAdsCommand.PostJobAd(ja); } #endregion #region set up an administrator if (admin) { CreateAdministrator(TestAdministratorUserId); } #endregion #region link up some users if (link) { _networkingCommand.CreateFirstDegreeLink(member.Id, two.Id); _networkingCommand.CreateFirstDegreeLink(member.Id, three.Id); _networkingCommand.CreateFirstDegreeLink(member.Id, four.Id); } if (link && fullSetOfNetworkers) { _networkingCommand.CreateFirstDegreeLink(two.Id, five.Id); _networkingCommand.CreateFirstDegreeLink(two.Id, six.Id); _networkingCommand.CreateFirstDegreeLink(three.Id, six.Id); } #endregion return(member); }