Пример #1
0
        private Employer CreateEmployer(int index)
        {
            var employer = _employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestOrganisation(1));

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = employer.Id
            });

            return(employer);
        }
Пример #2
0
        private void CreateEmployer(Employer employer)
        {
            // Set some defaults.

            employer.IsEnabled   = true;
            employer.IsActivated = true;

            // Always make sure the email is verified when created.

            if (employer.EmailAddress != null)
            {
                employer.EmailAddress.IsVerified = true;
            }

            // Always make sure the phone number is a work phone number.

            if (employer.PhoneNumber != null)
            {
                employer.PhoneNumber.Type = PhoneNumberType.Work;
            }

            // Save.

            _employersCommand.CreateEmployer(employer);

            // Create a job poster for this account.

            var poster = new JobPoster {
                Id = employer.Id, SendSuggestedCandidates = false, ShowSuggestedCandidates = true
            };

            _jobPostersCommand.CreateJobPoster(poster);
        }
Пример #3
0
        public void TestSnippetContent()
        {
            var employer = _employersCommand.CreateTestEmployer(_organisationsCommand.CreateTestOrganisation(0));

            var poster = new JobPoster {
                Id = employer.Id, SendSuggestedCandidates = false, ShowSuggestedCandidates = true
            };

            _jobPostersCommand.CreateJobPoster(poster);

            var jobAd = _jobAdsCommand.PostTestJobAd(employer, JobAdStatus.Open);

            jobAd.Description.Content += jobAd.Description.Content;
            jobAd.Description.Content += jobAd.Description.Content;

            var criteria = new JobAdSearchCriteria();

            criteria.SetKeywords("mutley");
            var highlighter = _highlighterFactory.Create(JobAdHighlighterKind.Full, criteria, new HighlighterConfiguration {
                FragmentSize = 40
            });

            var highlightedText = highlighter.SummarizeContent(jobAd);

            Assert.AreEqual("<span class=\"highlighted-word\">Mutley</span>, you snickering, floppy eared ...  never around.<span class=\"highlighted-word\">Mutley</span>, you snickering, floppy ...  is needed, you're never around.<span class=\"highlighted-word\">Mutley</span>, you snickering", highlightedText);
        }
Пример #4
0
        protected JobPoster CreateJobPoster()
        {
            var jobPoster = new JobPoster {
                Id = Guid.NewGuid()
            };

            _jobPostersCommand.CreateJobPoster(jobPoster);
            return(jobPoster);
        }
Пример #5
0
        protected Employer CreateEmployer(int index)
        {
            var employer = _employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestVerifiedOrganisation(index));

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = employer.Id
            });
            return(employer);
        }
Пример #6
0
        protected IEmployer CreateEmployer()
        {
            var employer = _employersCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = employer.Id
            });
            return(employer);
        }
Пример #7
0
        protected Employer CreateEmployer(IOrganisation organisation)
        {
            var employer = _employersCommand.CreateTestEmployer(0, organisation);

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = employer.Id
            });
            return(employer);
        }
Пример #8
0
        private Employer CreateEmployer()
        {
            var employer  = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var jobPoster = new JobPoster {
                Id = employer.Id
            };

            _jobPostersCommand.CreateJobPoster(jobPoster);
            return(employer);
        }
Пример #9
0
        public void TestAnonymousSavedDefault()
        {
            Get(HomeUrl);
            var anonymousId = GetAnonymousId();

            var jobAd = new JobAd
            {
                PosterId    = anonymousId,
                Title       = DefaultTitle,
                Description =
                {
                    Content = DefaultContent,
                },
            };

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = anonymousId
            });
            _jobAdsCommand.CreateJobAd(jobAd);

            // Check.

            Get(GetJobAdUrl(jobAd.Id));
            AssertJobAd(jobAd);
        }
Пример #10
0
        private JobAd CreateJobAd(Guid anonymousId, bool hasLogoFeature)
        {
            var poster = new JobPoster {
                Id = anonymousId
            };

            _jobPostersCommand.CreateJobPoster(poster);
            var jobAd = _jobAdsCommand.PostTestJobAd(new AnonymousUser {
                Id = anonymousId
            });

            AddLogo(jobAd, hasLogoFeature);
            return(jobAd);
        }
Пример #11
0
        void IAnonymousJobAdsCommand.CreateJobAd(AnonymousUser user, JobAd jobAd)
        {
            var poster = _jobPostersCommand.GetJobPoster(user.Id);

            if (poster == null)
            {
                poster = new JobPoster {
                    Id = user.Id
                };
                _jobPostersCommand.CreateJobPoster(poster);
            }

            jobAd.PosterId = poster.Id;
            _jobAdsCommand.CreateJobAd(jobAd);
        }
Пример #12
0
        private Employer CreateEmployer()
        {
            var employer = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = employer.Id
            });

            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <JobAdCredit>().Id, InitialQuantity = null, OwnerId = employer.Id
            });
            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <ApplicantCredit>().Id, InitialQuantity = null, OwnerId = employer.Id
            });

            return(employer);
        }