public void MatchesExpectedNumberOfItems(int blogId, int expectedCount) { var spec = new BlogByIdSpecification(blogId); var result = GetTestItemCollection() .AsQueryable() .Where(spec.Criteria); Assert.Equal(expectedCount, result.Count()); }
public async Task <IEnumerable <Blog> > GetAllBlogItems(int blogId) { var spec = new BlogByIdSpecification(blogId); return(await _blogRepository.ListAsync(spec)); }