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); }
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)); }
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); }
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); }
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); }
protected Member CreateMember() { var member = _membersCommand.CreateTestMember(0); var candidate = new Candidate { Id = member.Id }; _candidatesCommand.CreateCandidate(candidate); return(member); }
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)); }
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); }
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); } }
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); }
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); }
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); }
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); }
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); }
public void TestNoResume() { var candidate = new Candidate { Id = Guid.NewGuid() }; _candidatesCommand.CreateCandidate(candidate); Assert.IsNull(candidate.ResumeId); }