Example #1
0
        private Member CreateMember(IEmployer employer, int index, bool inFolder, bool isFlagged, bool hasNotes, bool hasBeenViewed, bool canContact)
        {
            var member = _memberAccountsCommand.CreateTestMember(index);

            _candidatesCommand.AddTestResume(member);

            // In folder.

            if (inFolder)
            {
                var folder = _candidateFoldersQuery.GetShortlistCandidateFolder(employer);
                _candidateListsCommand.AddCandidateToFolder(employer, folder, member.Id);
            }

            // Is flagged.

            if (isFlagged)
            {
                var flagList = _candidateFlagListsQuery.GetCandidateFlagList(employer);
                _candidateListsCommand.AddCandidateToFlagList(employer, flagList, member.Id);
            }

            // Has notes.

            if (hasNotes)
            {
                var note = new CandidateNote {
                    CandidateId = member.Id, Text = "A note"
                };
                _candidateNotesCommand.CreatePrivateCandidateNote(employer, note);
            }

            // Has been viewed.

            if (hasBeenViewed)
            {
                _employerMemberViewsCommand.ViewMember(employer, member);
            }

            // Has been contacted.

            if (canContact)
            {
                _employerMemberViewsCommand.AccessMember(employer, _employerMemberViewsQuery.GetProfessionalView(employer, member), MemberAccessReason.PhoneNumberViewed);
            }

            _updateMemberSearchCommand.AddMember(member.Id);
            return(member);
        }