コード例 #1
0
        public void ListsTestsInitialize()
        {
            Resolve <IDbConnectionFactory>().DeleteAllTestData();

            _blockList = null;
            _flagList  = null;
            _folder1   = null;
            _folder2   = null;
        }
コード例 #2
0
ファイル: JobAdFlagListsQuery.cs プロジェクト: formist/LinkMe
        private JobAdFlagList CreateSpecialFlagList(Guid memberId, FlagListType flagListType)
        {
            var list = new JobAdFlagList {
                MemberId = memberId, FlagListType = flagListType
            };

            _jobAdListsCommand.CreateList(list);
            return(list);
        }
コード例 #3
0
        private void CreateLists(IMember member)
        {
            _blockList = _jobAdBlockListsQuery.GetBlockList(member);
            _flagList  = _jobAdFlagListsQuery.GetFlagList(member);

            var folders = _jobAdFoldersQuery.GetFolders(member);

            _folder1 = folders[1];
            _folder2 = folders[2];
        }
コード例 #4
0
        int IMemberJobAdListsCommand.RemoveJobAdsFromFlagList(IMember member, JobAdFlagList flagList, IEnumerable <Guid> jobAdIds)
        {
            if (!CanModifyJobAds(member, flagList))
            {
                throw new JobAdFlagListsPermissionsException(member, flagList.Id);
            }

            RemoveJobAdsFromList(flagList.Id, jobAdIds);
            return(_jobAdListsQuery.GetListedCount(flagList.Id, new[] { (int)BlockListType.Permanent }));
        }
コード例 #5
0
        int IMemberJobAdListsCommand.AddJobAdToFlagList(IMember member, JobAdFlagList list, Guid jobAdId)
        {
            if (!CanModifyJobAds(member, list))
            {
                throw new JobAdFlagListsPermissionsException(member, list.Id);
            }

            AddJobAdsToFlagList(member.Id, list.Id, new[] { jobAdId });
            return(_jobAdListsQuery.GetListedCount(list.Id, new[] { (int)BlockListType.Permanent }));
        }
コード例 #6
0
        private static bool CanModifyJobAds(IMember member, JobAdFlagList flagList)
        {
            if (!CanAccessFlagList(member, flagList, false))
            {
                return(false);
            }

            // Must own the flagList.

            return(flagList.MemberId == member.Id);
        }