Ejemplo n.º 1
0
        IList <Guid> IMemberActivityFiltersQuery.GetFolderIncludeMemberIds(IEmployer employer, Guid folderId, MemberSearchQuery query)
        {
            // Include those in the folder.

            var memberIds = _candidateFoldersQuery.GetInFolderCandidateIds(employer, folderId);

            // Include filters.

            return(GetIncludeMemberIds(employer, query, memberIds));
        }
Ejemplo n.º 2
0
        protected void AssertFolderEntries(IEmployer employer, CandidateFolder folder, ICollection <Member> inFolderMembers, ICollection <Member> notInFolderMembers)
        {
            // IsInFolder

            foreach (var inFolderMember in inFolderMembers)
            {
                Assert.IsTrue(_candidateFoldersQuery.IsInFolder(employer, folder.Id, inFolderMember.Id));
            }
            foreach (var notInFolderMember in notInFolderMembers)
            {
                Assert.IsFalse(_candidateFoldersQuery.IsInFolder(employer, folder.Id, notInFolderMember.Id));
            }

            if (folder.FolderType == FolderType.Mobile)
            {
                foreach (var member in inFolderMembers)
                {
                    Assert.IsTrue(_candidateFoldersQuery.IsInMobileFolder(employer, member.Id));
                }
                foreach (var member in notInFolderMembers)
                {
                    Assert.IsFalse(_candidateFoldersQuery.IsInMobileFolder(employer, member.Id));
                }
            }

            // GetInFolderCandidateIds

            Assert.IsTrue((from m in inFolderMembers select m.Id).CollectionEqual(_candidateFoldersQuery.GetInFolderCandidateIds(employer, folder.Id)));
            if (folder.FolderType == FolderType.Mobile)
            {
                Assert.IsTrue((from m in inFolderMembers select m.Id).CollectionEqual(_candidateFoldersQuery.GetInMobileFolderCandidateIds(employer, from m in inFolderMembers.Concat(notInFolderMembers) select m.Id)));
            }

            // GetInFolderCounts.

            var counts = _candidateFoldersQuery.GetInFolderCounts(employer);

            if (counts.ContainsKey(folder.Id))
            {
                Assert.AreEqual(inFolderMembers.Count, counts[folder.Id]);
            }
            else
            {
                Assert.AreEqual(inFolderMembers.Count, 0);
            }
        }
Ejemplo n.º 3
0
        protected void AssertCandidates(IEmployer employer, Guid folderId, params Member[] expectedMembers)
        {
            var candidateIds = _candidateFoldersQuery.GetInFolderCandidateIds(employer, folderId);

            Assert.AreEqual(expectedMembers.Length, candidateIds.Count);
            for (var index = 0; index < expectedMembers.Length; ++index)
            {
                var expectedMemberId = expectedMembers[index].Id;
                Assert.AreEqual(true, (from e in candidateIds where e == expectedMemberId select e).Any());
            }
        }