public void ListsTestsInitialize() { Resolve <IDbConnectionFactory>().DeleteAllTestData(); _blockList = null; _flagList = null; _folder1 = null; _folder2 = null; }
private JobAdFlagList CreateSpecialFlagList(Guid memberId, FlagListType flagListType) { var list = new JobAdFlagList { MemberId = memberId, FlagListType = flagListType }; _jobAdListsCommand.CreateList(list); return(list); }
private void CreateLists(IMember member) { _blockList = _jobAdBlockListsQuery.GetBlockList(member); _flagList = _jobAdFlagListsQuery.GetFlagList(member); var folders = _jobAdFoldersQuery.GetFolders(member); _folder1 = folders[1]; _folder2 = folders[2]; }
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 })); }
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 })); }
private static bool CanModifyJobAds(IMember member, JobAdFlagList flagList) { if (!CanAccessFlagList(member, flagList, false)) { return(false); } // Must own the flagList. return(flagList.MemberId == member.Id); }