Esempio n. 1
0
        protected void AssertJobAds(IMember member, Guid folderId, params JobAd[] expectedJobAds)
        {
            var jobAdIds = _jobAdFoldersQuery.GetInFolderJobAdIds(member, folderId);

            Assert.AreEqual(expectedJobAds.Length, jobAdIds.Count);
            foreach (var expectedJobAd in expectedJobAds)
            {
                var expectedJobAdId = expectedJobAd.Id;
                Assert.AreEqual(true, (from e in jobAdIds where e == expectedJobAdId select e).Any());
            }
        }
Esempio n. 2
0
        protected void AssertFolderEntries(IMember member, JobAdFolder folder, ICollection <IJobAd> inFolderJobAds, ICollection <IJobAd> notInFolderJobAds)
        {
            // IsInFolder

            foreach (var inFolderJobAd in inFolderJobAds)
            {
                Assert.IsTrue(_jobAdFoldersQuery.IsInFolder(member, folder.Id, inFolderJobAd.Id));
            }
            foreach (var notInFolderJobAd in notInFolderJobAds)
            {
                Assert.IsFalse(_jobAdFoldersQuery.IsInFolder(member, folder.Id, notInFolderJobAd.Id));
            }

            // GetInFolderJobAdIds

            Assert.IsTrue((from m in inFolderJobAds select m.Id).CollectionEqual(_jobAdFoldersQuery.GetInFolderJobAdIds(member, folder.Id)));

            // GetInFolderCounts.

            var counts = _jobAdFoldersQuery.GetInFolderCounts(member);

            Assert.AreEqual(inFolderJobAds.Count, counts.ContainsKey(folder.Id) ? counts[folder.Id] : 0);
        }
Esempio n. 3
0
 IList <Guid> IJobAdSortFiltersQuery.GetFolderIncludeJobAdIds(IMember member, Guid folderId)
 {
     return(_jobAdFoldersQuery.GetInFolderJobAdIds(member, folderId));
 }