예제 #1
0
        private Candidate CreateCandidateWithResumeFile()
        {
            // Create member.

            var member = _membersCommand.CreateTestMember(0);

            member.CreatedTime = DateTime.Now.AddDays(-10);
            _membersCommand.UpdateMember(member);

            // Create candidate.

            var candidate = new Candidate {
                Id = member.Id
            };

            _candidatesCommand.CreateCandidate(candidate);

            // Create resume file.

            var fileReference = GetResumeFile();
            var resume        = new Resume {
                Citizenship = "Something"
            };

            _candidateResumesCommand.CreateResume(candidate, resume, fileReference);

            return(candidate);
        }
예제 #2
0
        public void TestCreateResumeFile()
        {
            var candidateId = Guid.NewGuid();

            _candidatesCommand.CreateCandidate(new Candidate {
                Id = candidateId
            });

            var file = _filesCommand.CreateTestFile(FileType.Resume);
            var resumeFileReference = new ResumeFileReference {
                FileReferenceId = file.Id
            };

            _candidateResumeFilesCommand.CreateResumeFile(candidateId, resumeFileReference);

            Assert.AreNotEqual(Guid.Empty, resumeFileReference.Id);
            Assert.AreNotEqual(DateTime.MinValue, resumeFileReference.UploadedTime);
            Assert.AreNotEqual(DateTime.MinValue, resumeFileReference.LastUsedTime);

            AssertResumeFile(resumeFileReference, _candidateResumeFilesQuery.GetResumeFile(candidateId, file.Id));
            var resumeFileReferences = _candidateResumeFilesQuery.GetResumeFiles(candidateId);

            Assert.AreEqual(1, resumeFileReferences.Count);
            AssertResumeFile(resumeFileReference, resumeFileReferences[0]);
            AssertResumeFile(resumeFileReference, _candidateResumeFilesQuery.GetLastUsedResumeFile(candidateId));
        }
예제 #3
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);
        }
예제 #4
0
        private IMember CreateMember()
        {
            var member = _membersCommand.CreateTestMember(0);

            member.Address.Location = _locationQuery.ResolveLocation(_locationQuery.GetCountry(Country), Location);
            _membersCommand.UpdateMember(member);

            var candidate = new Candidate {
                Id = member.Id
            };

            _candidatesCommand.CreateCandidate(candidate);

            // Give them a resume.

            var resume = new Resume
            {
                Jobs = new List <Job>
                {
                    new Job {
                        Title = JobTitle
                    }
                }
            };

            _candidateResumesCommand.CreateResume(candidate, resume);
            return(member);
        }
        private Member CreateMember(int index)
        {
            var member = _membersCommand.CreateTestMember(index);

            _candidatesCommand.CreateCandidate(new Candidate {
                Id = member.Id
            });
            return(member);
        }
예제 #6
0
 private void AddMember(MemberContent content)
 {
     content.Member.Address = new Address {
         Location = _locationQuery.ResolveLocation(_locationQuery.GetCountry("Australia"), null)
     };
     _membersCommand.CreateMember(content.Member);
     content.Candidate.Id = content.Member.Id;
     _candidatesCommand.CreateCandidate(content.Candidate);
     _searchService.UpdateMember(content.Member.Id);
 }
예제 #7
0
        protected Member CreateMember()
        {
            var member    = _membersCommand.CreateTestMember(0);
            var candidate = new Candidate {
                Id = member.Id
            };

            _candidatesCommand.CreateCandidate(candidate);
            return(member);
        }
예제 #8
0
        public void TestCreateDiary()
        {
            // Create a candidate.

            var candidateId = Guid.NewGuid();

            _candidatesCommand.CreateCandidate(new Candidate {
                Id = candidateId
            });

            // Create it.

            var diary = new Diary();

            _candidateDiariesCommand.CreateDiary(candidateId, diary);
            Assert.AreNotEqual(Guid.Empty, diary.Id);

            // Get it.

            Assert.AreEqual(diary, _candidateDiariesQuery.GetDiary(diary.Id));
        }
예제 #9
0
        public void TestCompleteResume()
        {
            var candidate = new Candidate {
                Id = Guid.NewGuid()
            };

            _candidatesCommand.CreateCandidate(candidate);

            const string fileName = "resume.doc";
            var          data     = TestResume.Complete.GetData();

            FileReference fileReference;

            using (var stream = new MemoryStream(data))
            {
                fileReference = _filesCommand.SaveFile(FileType.Resume, new StreamFileContents(stream), fileName);
            }

            var resume = _parseResumesCommand.ParseResume(data, fileName).Resume;

            _candidateResumesCommand.CreateResume(candidate, resume, fileReference);

            AssertResume(_candidatesCommand.GetCandidate(candidate.Id), resume, fileReference);
        }
예제 #10
0
        private void CreateMember(Member member, Guid?affiliateId)
        {
            _membersCommand.CreateMember(member);

            var candidate = new Candidate
            {
                Id                   = member.Id,
                Status               = Defaults.CandidateStatus,
                DesiredJobTypes      = Defaults.DesiredJobTypes,
                RelocationPreference = Defaults.RelocationPreference,
            };

            _candidatesCommand.CreateCandidate(candidate);

            if (affiliateId != null)
            {
                _memberAffiliationsCommand.SetAffiliation(member.Id, affiliateId.Value);
            }
        }
예제 #11
0
        protected Member CreateMember(int index, Action <Member, Candidate, Resume> initialiseMember)
        {
            var member = new Member
            {
                EmailAddresses = new List <EmailAddress> {
                    new EmailAddress {
                        Address = string.Format(EmailAddressFormat, index), IsVerified = true
                    }
                },
                FirstName = string.Format(FirstNameFormat, index),
                LastName  = string.Format(LastNameFormat, index),
                Address   = new Address {
                    Location = _locationQuery.ResolveLocation(_locationQuery.GetCountry("Australia"), null)
                },
                IsEnabled          = true,
                IsActivated        = true,
                VisibilitySettings = new VisibilitySettings {
                    Professional = { EmploymentVisibility = ProfessionalVisibility.All }
                },
            };
            var candidate = new Candidate
            {
                Status = CandidateStatus.ActivelyLooking,
            };
            var resume = new Resume
            {
                Objective = string.Format(ObjectiveFormat, index),
            };

            if (initialiseMember != null)
            {
                initialiseMember(member, candidate, resume);
            }

            _membersCommand.CreateMember(member);
            candidate.Id = member.Id;
            _candidatesCommand.CreateCandidate(candidate);
            _candidateResumesCommand.CreateResume(candidate, resume);

            _memberSearchService.UpdateMember(member.Id);
            return(member);
        }
예제 #12
0
        public void TestNoWorkflow()
        {
            var candidate = new Candidate {
                Id = Guid.NewGuid(), Status = CandidateStatus.AvailableNow
            };

            _candidatesCommand.CreateCandidate(candidate);

            Assert.IsNull(_candidatesWorkflowCommand.GetStatusWorkflowId(candidate.Id));
            var without = _candidatesWorkflowQuery.GetCandidatesWithoutStatusWorkflow();

            Assert.AreEqual(1, without.Count);
            Assert.AreEqual(candidate.Id, without[0].Item1);
            Assert.AreEqual(candidate.Status, without[0].Item2);
        }
예제 #13
0
        private Member CreateMember(int index, bool isResumeVisible, bool hasResume)
        {
            var member = _membersCommand.CreateTestMember(index);

            var candidate = new Candidate {
                Id = member.Id
            };

            _candidatesCommand.CreateCandidate(candidate);
            if (hasResume)
            {
                _candidateResumesCommand.AddTestResume(candidate);
            }

            member.VisibilitySettings.Professional.EmploymentVisibility = isResumeVisible
                ? member.VisibilitySettings.Professional.EmploymentVisibility.SetFlag(ProfessionalVisibility.Resume)
                : member.VisibilitySettings.Professional.EmploymentVisibility.ResetFlag(ProfessionalVisibility.Resume);

            _membersCommand.UpdateMember(member);
            return(member);
        }
예제 #14
0
        private static void CreateInvalidMember(Member member, LoginCredentials credentials, Guid?affiliateId)
        {
            // Check login credentials.

            if (LoginCredentialsQuery.DoCredentialsExist(credentials))
            {
                throw new DuplicateUserException();
            }

            // Set some defaults.

            member.IsEnabled   = true;
            member.AffiliateId = affiliateId;

            // Save.
            member.Prepare();

            MembersRepository.CreateMember(member);

            var candidate = new Candidate
            {
                Id                   = member.Id,
                Status               = Defaults.CandidateStatus,
                DesiredJobTypes      = Defaults.DesiredJobTypes,
                RelocationPreference = Defaults.RelocationPreference,
            };

            CandidatesCommand.CreateCandidate(candidate);

            if (affiliateId != null)
            {
                MemberAffiliationsCommand.SetAffiliation(member.Id, affiliateId.Value);
            }

            LoginCredentialsCommand.CreateCredentials(member.Id, credentials);

            //Update search

            //MemberSearchService.UpdateMember(member.Id);
        }
예제 #15
0
        private Member CreateMember()
        {
            var member    = _membersCommand.CreateTestMember(0);
            var candidate = new Candidate {
                Id = member.Id
            };

            _candidatesCommand.CreateCandidate(candidate);

            const string  fileName = "resume.doc";
            var           data     = TestResume.Complete.GetData();
            FileReference fileReference;

            using (var stream = new MemoryStream(data))
            {
                fileReference = _filesCommand.SaveFile(FileType.Resume, new StreamFileContents(stream), fileName);
            }

            var resume = _parseResumesCommand.ParseResume(fileReference).Resume;

            _candidateResumesCommand.CreateResume(candidate, resume);
            return(member);
        }
예제 #16
0
        public void TestNoResume()
        {
            var candidate = new Candidate {
                Id = Guid.NewGuid()
            };

            _candidatesCommand.CreateCandidate(candidate);
            Assert.IsNull(candidate.ResumeId);
        }