public void MatchesExpectedNumberOfItems(int categoryId, int expectedCount) { var spec = new CategoryByIdSpecification(categoryId); var result = GetTestItemCollection() .AsQueryable() .Where(spec.Criteria); Assert.Equal(expectedCount, result.Count()); }
public async Task <IEnumerable <Category> > GetAllCategoryItems(int categoryId) { var spec = new CategoryByIdSpecification(categoryId); return(await _categoryRepository.ListAsync(spec)); }