public void Should_not_return_members_when_name_is_Illidan() { var criteria = new CommunityCriteria { Name = "Illidan" }; var results = _communityDao.GetCommunities(criteria).Result; results.Should().BeEmpty(); }
public void Should_not_return_members_when_email_is_not_found() { var criteria = new CommunityCriteria { Email = "*****@*****.**" }; var results = _communityDao.GetCommunities(criteria).Result; results.Should().BeEmpty(); }
public void Should_return_members_when_name_is_AgileCommunity() { var criteria = new CommunityCriteria { Name = "Agile Community" }; var results = _communityDao.GetCommunities(criteria).Result; results.Should().NotBeEmpty(); results.Should().OnlyContain(r => r.Name.Contains(criteria.Name)); }
public void Should_return_members_when_email_is_found() { var criteria = new CommunityCriteria { Email = "*****@*****.**" }; var results = _communityDao.GetCommunities(criteria).Result; results.Should().NotBeEmpty(); results.Should().OnlyContain(r => criteria.Email == r.Email); }
public void Should_not_return_members_when_ids_are_5() { var criteria = new CommunityCriteria { Ids = new List <int> { 5 } }; var results = _communityDao.GetCommunities(criteria).Result; results.Should().BeEmpty(); }
public async Task <IEnumerable <Community> > GetCommunities(CommunityCriteria criteria) { var dtos = await Task.Run(() => FakeCommunitiesDb.Communities).ConfigureAwait(false); Func <CommunityDto, bool> criteriaFilters = dto => true; return(dtos.Where( criteriaFilters .FilterOnIds(criteria.Ids) .FilterOnEmail(criteria.Email) .FilterOnName(criteria.Name)) .Select(_entityFactory.TransformToCommunityEntity)); }
public void Should_return_members_when_ids_are_1_2() { var criteria = new CommunityCriteria { Ids = new List <int> { 1, 2 } }; var results = _communityDao.GetCommunities(criteria).Result; results.Should().NotBeEmpty(); results.Should().OnlyContain(r => criteria.Ids.Contains(r.Id)); }
public async Task <int> CountCommunities(CommunityCriteria criteria) { return((await GetCommunities(criteria)).Count()); }