Beispiel #1
0
        private Employer CreateEmployer()
        {
            var employer  = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var jobPoster = _jobPostersCommand.GetJobPoster(employer.Id);

            jobPoster.SendSuggestedCandidates = true;
            _jobPostersCommand.UpdateJobPoster(jobPoster);
            return(employer);
        }
        private new Employer CreateEmployer()
        {
            var employer  = base.CreateEmployer();
            var jobPoster = new JobPoster {
                Id = employer.Id, SendSuggestedCandidates = true
            };

            _jobPostersCommand.UpdateJobPoster(jobPoster);
            return(employer);
        }
        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();
        }
Beispiel #4
0
        private void UpdateSuggestedCandidates(IEmployer employer, bool showSuggestedCandidates, bool sendSuggestedCandidates, bool receiveSuggestedCandidates)
        {
            // Update the job poster.

            var jobPoster = _jobPostersQuery.GetJobPoster(employer.Id) ?? new JobPoster {
                Id = employer.Id
            };

            if (showSuggestedCandidates != jobPoster.ShowSuggestedCandidates || sendSuggestedCandidates != jobPoster.SendSuggestedCandidates)
            {
                jobPoster.ShowSuggestedCandidates = showSuggestedCandidates;
                jobPoster.SendSuggestedCandidates = sendSuggestedCandidates;
                _jobPostersCommand.UpdateJobPoster(jobPoster);
            }

            // Update the non-member settings.

            var nonMemberSettings = _nonMemberSettingsQuery.GetNonMemberSettings(employer.EmailAddress.Address);

            if (nonMemberSettings != null)
            {
                if (receiveSuggestedCandidates == nonMemberSettings.SuppressSuggestedCandidatesEmails)
                {
                    nonMemberSettings.SuppressSuggestedCandidatesEmails = !receiveSuggestedCandidates;
                    _nonMemberSettingsCommand.UpdateNonMemberSettings(nonMemberSettings);
                }
            }
            else if (!receiveSuggestedCandidates)
            {
                // !Suppress is the default state, so if there are no settings that's fine.

                nonMemberSettings = new NonMemberSettings
                {
                    EmailAddress = employer.EmailAddress.Address,
                    SuppressSuggestedCandidatesEmails = true
                };
                _nonMemberSettingsCommand.CreateNonMemberSettings(nonMemberSettings);
            }
        }