Пример #1
0
        public void TestEnabled()
        {
            var employer = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            _userAccountsCommand.EnableUserAccount(employer, Guid.NewGuid());
            _userAccountsCommand.ActivateUserAccount(employer, Guid.NewGuid());

            employer = _employersQuery.GetEmployer(employer.Id);
            Assert.IsTrue(employer.IsEnabled);
            Assert.IsTrue(employer.IsActivated);
            Assert.IsTrue(_userAccountsQuery.IsEnabled(employer.Id));
            Assert.IsTrue(_userAccountsQuery.IsActive(employer.Id));

            // Disable.

            _userAccountsCommand.DisableUserAccount(employer, Guid.NewGuid());

            employer = _employersQuery.GetEmployer(employer.Id);
            Assert.IsFalse(employer.IsEnabled);
            Assert.IsTrue(employer.IsActivated);
            Assert.IsFalse(_userAccountsQuery.IsEnabled(employer.Id));
            Assert.IsFalse(_userAccountsQuery.IsActive(employer.Id));

            // Enable.

            _userAccountsCommand.EnableUserAccount(employer, Guid.NewGuid());

            employer = _employersQuery.GetEmployer(employer.Id);
            Assert.IsTrue(employer.IsEnabled);
            Assert.IsTrue(employer.IsActivated);
            Assert.IsTrue(_userAccountsQuery.IsEnabled(employer.Id));
            Assert.IsTrue(_userAccountsQuery.IsActive(employer.Id));
        }
Пример #2
0
        public void TestMemberViewsWithLinkMe()
        {
            // It used to be the case that we filtered out LinkMe employers from these reports but given the
            // changes in the company etc we will include them from now on because it makes things a whole lot
            // easier, and stats from LinkMe should not be significant now.

            var organisation = _organisationsCommand.CreateTestVerifiedOrganisation("LinkMe");
            var employer1    = _employersCommand.CreateTestEmployer(0, organisation);

            var employer2 = _employersCommand.CreateTestEmployer(2, _organisationsCommand.CreateTestOrganisation(2));
            var member1   = _membersCommand.CreateTestMember(1);
            var member2   = _membersCommand.CreateTestMember(2);
            var member3   = _membersCommand.CreateTestMember(3);

            // Make some viewings.

            var channel = _channelsQuery.GetChannel("Web");
            var app     = _channelsQuery.GetChannelApp(channel.Id, "Web");

            _employerMemberViewsCommand.ViewMember(app, employer1, member1);
            Assert.AreEqual(1, _dailyReportsQuery.GetDailyReport(DayRange.Today).MemberViewingReports["Web"].TotalViewings);

            _employerMemberViewsCommand.ViewMember(app, employer2, member1);
            Assert.AreEqual(2, _dailyReportsQuery.GetDailyReport(DayRange.Today).MemberViewingReports["Web"].TotalViewings);

            _employerMemberViewsCommand.ViewMember(app, employer1, member2);
            Assert.AreEqual(3, _dailyReportsQuery.GetDailyReport(DayRange.Today).MemberViewingReports["Web"].TotalViewings);

            _employerMemberViewsCommand.ViewMember(app, employer2, member3);
            Assert.AreEqual(4, _dailyReportsQuery.GetDailyReport(DayRange.Today).MemberViewingReports["Web"].TotalViewings);
        }
Пример #3
0
        private Employer CreateEmployer(int index)
        {
            var employer = _employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestOrganisation(1));

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

            return(employer);
        }
Пример #4
0
        public void TestUpdateFirstName()
        {
            var employer = _employersCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));

            AssertEmployer(employer, _employersQuery.GetEmployer(employer.Id));

            employer.FirstName = "Changed";
            _employersCommand.UpdateEmployer(employer);
            AssertEmployer(employer, _employersQuery.GetEmployer(employer.Id));
        }
Пример #5
0
        public void TestOrder()
        {
            var employer = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            Assert.AreEqual(0, _orderReportsQuery.GetOrderReports(DayRange.Today).Count);

            var product = _productsQuery.GetProduct("Contacts5");
            var order   = _ordersCommand.PrepareOrder(new[] { product.Id }, null, null, CreditCardType.MasterCard);

            _ordersCommand.PurchaseOrder(employer.Id, order, CreatePurchaser(employer.Id), CreateCreditCard());

            AssertOrders(new[] { order }, new[] { employer });
        }
Пример #6
0
        public void TestConvertResumeToRtf()
        {
            var employer = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var member1  = _membersCommand.CreateTestMember(1);
            var member2  = _membersCommand.CreateTestMember(2);

            var candidate1 = new Candidate {
                Id = member1.Id
            };

            _candidatesCommand.CreateCandidate(candidate1);
            var candidate2 = new Candidate {
                Id = member2.Id
            };

            _candidatesCommand.CreateCandidate(candidate2);

            var resume1 = _candidateResumesCommand.AddTestResume(candidate1);
            var resume2 = _candidateResumesCommand.AddTestResume(candidate2);

            var resumeFile1 = _resumeFilesQuery.GetResumeFile(employer, member1, candidate1, resume1);
            var resumeFile2 = _resumeFilesQuery.GetResumeFile(employer, member2, candidate2, resume2);

            Assert.IsTrue(resumeFile1.Contents.Length > 1000);
            Assert.IsTrue(resumeFile2.Contents.Length > 1000);
        }
Пример #7
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);
        }
Пример #8
0
 public static Employer CreateTestRecruiter(this IEmployersCommand employersCommand, IOrganisation organisation)
 {
     return(employersCommand.CreateTestEmployer(
                string.Format(EmailAddressFormat, 0),
                string.Format(FirstNameFormat, 0),
                string.Format(LastNameFormat, 0),
                EmployerSubRole.Recruiter,
                organisation));
 }
Пример #9
0
        private IEmployer CreateEmployer()
        {
            var employer = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, OwnerId = employer.Id
            });
            return(employer);
        }
Пример #10
0
        protected Employer CreateEmployer(int index)
        {
            var employer = _employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestVerifiedOrganisation(index));

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

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

            _jobPostersCommand.CreateJobPoster(new JobPoster {
                Id = employer.Id
            });
            return(employer);
        }
Пример #13
0
 public static Employer CreateTestEmployer(this IEmployersCommand employersCommand, string emailAddress, string firstName, string lastName, IOrganisation organisation)
 {
     return(employersCommand.CreateTestEmployer(
                emailAddress,
                firstName,
                lastName,
                EmployerSubRole.Employer,
                organisation));
 }
Пример #14
0
        private Employer CreateEmployer()
        {
            var employer  = _employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var jobPoster = new JobPoster {
                Id = employer.Id
            };

            _jobPostersCommand.CreateJobPoster(jobPoster);
            return(employer);
        }
Пример #15
0
        private Employer CreateEmployer(int index, bool allocateCredits, int?quantity)
        {
            var employer = _employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestOrganisation(index));

            if (allocateCredits)
            {
                _allocationsCommand.CreateAllocation(new Allocation {
                    CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, OwnerId = employer.Id, InitialQuantity = quantity
                });
            }
            return(employer);
        }
Пример #16
0
        public void TestGetMemberViews()
        {
            var channel = _channelsQuery.GetChannel("Web");
            var app     = _channelsQuery.GetChannelApp(channel.Id, "Web");

            Assert.AreEqual(0, _employerMemberAccessReportsQuery.GetEmployerMemberViewingReport(channel, DayRange.Today).TotalViewings);

            // Make some viewings.

            var employer1 = _employersCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));
            var employer2 = _employersCommand.CreateTestEmployer(2, _organisationsCommand.CreateTestOrganisation(2));
            var member1   = _membersCommand.CreateTestMember(1);
            var member2   = _membersCommand.CreateTestMember(2);
            var member3   = _membersCommand.CreateTestMember(3);

            _employerMemberViewsCommand.ViewMember(app, employer1, member1);
            Assert.AreEqual(1, _employerMemberAccessReportsQuery.GetEmployerMemberViewingReport(channel, DayRange.Today).TotalViewings);

            _employerMemberViewsCommand.ViewMember(app, employer1, member2);
            Assert.AreEqual(2, _employerMemberAccessReportsQuery.GetEmployerMemberViewingReport(channel, DayRange.Today).TotalViewings);

            _employerMemberViewsCommand.ViewMember(app, employer2, member1);
            Assert.AreEqual(3, _employerMemberAccessReportsQuery.GetEmployerMemberViewingReport(channel, DayRange.Today).TotalViewings);

            _employerMemberViewsCommand.ViewMember(app, employer2, member3);
            Assert.AreEqual(4, _employerMemberAccessReportsQuery.GetEmployerMemberViewingReport(channel, DayRange.Today).TotalViewings);
        }
Пример #17
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);
        }
Пример #18
0
 private IEmployer CreateEmployer(int index)
 {
     return(_employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestOrganisation(index)));
 }
Пример #19
0
        public void TestFilterFolderId()
        {
            var member1  = CreateJobAd(1);
            var member2  = CreateJobAd(2);
            var employer = _employersCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));

            // Member1 in folder.

            var folder = _candidateFoldersQuery.GetShortlistCandidateFolder(employer);

            _candidateListsCommand.AddCandidateToFolder(employer, folder, member1.Id);

            // Filter.

            var allMemberIds = new[] { member1.Id, member2.Id };

            TestFilter(allMemberIds, employer, new AdvancedMemberSearchCriteria());
            TestFilter(new[] { member1.Id }, employer, new AdvancedMemberSearchCriteria {
                FolderId = folder.Id
            });
        }
Пример #20
0
 private Employer CreateEmployer()
 {
     return(_employersCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0)));
 }
Пример #21
0
        public void TestFilterInFolders()
        {
            var member1  = CreateMember(1);
            var member2  = CreateMember(2);
            var employer = _employersCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));

            // Member1 in folder.

            var folder = _candidateFoldersQuery.GetShortlistFolder(employer);

            _candidateListsCommand.AddCandidateToFolder(employer, folder, member1.Id);

            // Filter.

            TestFilter(employer, CreateInFolderCriteria, new[] { member1.Id, member2.Id }, new[] { member1.Id }, new[] { member2.Id });
        }
Пример #22
0
        public void TestOrganisationSharedNotes()
        {
            var member      = _membersCommand.CreateTestMember(1);
            var noteCreator = _employersCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));

            var organisation = noteCreator.Organisation;
            var noteReader   = _employersCommand.CreateTestEmployer(2, organisation);

            // Create a private and a shared.

            var note1 = CreateNote(1, noteCreator, member.Id, false);

            NoteCreationDelay();
            var note2 = CreateNote(2, noteCreator, member.Id, true);

            AssertNotes(noteCreator, member.Id, new[] { note2, note1 }, new CandidateNote[0]);
            AssertNotes(noteReader, member.Id, new[] { note2 }, new[] { note1 });
            AssertHasNotes(noteCreator, member.Id);
            AssertHasNotes(noteReader, member.Id);

            // The creator leaves the company, so they cannot access their own shared notes.

            var otherOrganisation = new Organisation {
                Name = "OtherOrganisation"
            };

            _organisationsCommand.CreateOrganisation(otherOrganisation);

            noteCreator.Organisation = otherOrganisation;
            _employersCommand.UpdateEmployer(noteCreator);

            AssertNotes(noteCreator, member.Id, new[] { note1 }, new[] { note2 });
            AssertNotes(noteReader, member.Id, new[] { note2 }, new[] { note1 });
            AssertHasNotes(noteCreator, member.Id);
            AssertHasNotes(noteReader, member.Id);

            // Create a private while not part of the company.

            var note3 = CreateNote(3, noteCreator, member.Id, false);

            AssertNotes(noteCreator, member.Id, new[] { note3, note1 }, new[] { note2 });
            AssertNotes(noteReader, member.Id, new[] { note2 }, new[] { note3, note1 });
            AssertHasNotes(noteCreator, member.Id);
            AssertHasNotes(noteReader, member.Id);

            // Join again so can see original notes.

            noteCreator.Organisation = organisation;
            _employersCommand.UpdateEmployer(noteCreator);

            AssertNotes(noteCreator, member.Id, new[] { note3, note2, note1 }, new CandidateNote[0]);
            AssertNotes(noteReader, member.Id, new[] { note2 }, new[] { note3, note1 });
            AssertHasNotes(noteCreator, member.Id);
            AssertHasNotes(noteReader, member.Id);

            // Change the latest to shared, so now the second employer can see it.

            _candidateNotesCommand.ShareNote(noteCreator, note3);

            AssertNotes(noteCreator, member.Id, new[] { note3, note2, note1 }, new CandidateNote[0]);
            AssertNotes(noteReader, member.Id, new[] { note3, note2 }, new[] { note1 });
            AssertHasNotes(noteCreator, member.Id);
            AssertHasNotes(noteReader, member.Id);

            // Make that one private once again.

            _candidateNotesCommand.UnshareNote(noteCreator, note3);

            AssertNotes(noteCreator, member.Id, new[] { note3, note2, note1 }, new CandidateNote[0]);
            AssertNotes(noteReader, member.Id, new[] { note2 }, new[] { note3, note1 });
            AssertHasNotes(noteCreator, member.Id);
            AssertHasNotes(noteReader, member.Id);
        }
Пример #23
0
 protected Employer CreateEmployer(int index)
 {
     return(_employersCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestVerifiedOrganisation(index)));
 }
Пример #24
0
 private Employer CreateEmployer(IOrganisation organisation)
 {
     return(_employersCommand.CreateTestEmployer(0, organisation));
 }