Exemple #1
0
 private MemberJobAdView GetMemberJobAdView(IMember member, JobAd jobAd)
 {
     return(new MemberJobAdView(
                jobAd,
                _jobAdProcessingQuery.GetJobAdProcessing(jobAd),
                GetContactDetails(_employersQuery.GetEmployer(jobAd.PosterId), jobAd),
                GetEmployerCompanyName(jobAd),
                member != null && _jobAdViewsQuery.HasViewedJobAd(member.Id, jobAd.Id),
                member != null && _jobAdApplicationSubmissionsQuery.HasSubmittedApplication(member.Id, jobAd.Id),
                member != null && _jobAdFlagListsQuery.IsFlagged(member, jobAd.Id),
                member != null && _jobAdFoldersQuery.IsInMobileFolder(member, jobAd.Id)));
 }
        protected void AssertFlagListEntries(IMember member, ICollection <IJobAd> isFlaggedJobAds, ICollection <IJobAd> isNotFlaggedJobAds)
        {
            // IsFlagged.

            foreach (var isFlaggedJobAd in isFlaggedJobAds)
            {
                Assert.IsTrue(_jobAdFlagListsQuery.IsFlagged(member, isFlaggedJobAd.Id));
            }
            foreach (var isNotFlaggedMember in isNotFlaggedJobAds)
            {
                Assert.IsFalse(_jobAdFlagListsQuery.IsFlagged(member, isNotFlaggedMember.Id));
            }

            // GetFlaggedCount.

            Assert.AreEqual(isFlaggedJobAds.Count, _jobAdFlagListsQuery.GetFlaggedCount(member));

            // GetFlaggedCandidateIds.

            Assert.IsTrue((from j in isFlaggedJobAds select j.Id).CollectionEqual(_jobAdFlagListsQuery.GetFlaggedJobAdIds(member)));
            Assert.IsTrue((from j in isFlaggedJobAds select j.Id).CollectionEqual(_jobAdFlagListsQuery.GetFlaggedJobAdIds(member, from j in isFlaggedJobAds.Concat(isNotFlaggedJobAds) select j.Id)));
        }