public void MatchesExpectedNumberOfItems(int categoryId, int expectedCount) { var spec = new ProductByIdSpecification(categoryId); var result = GetTestItemCollection() .AsQueryable() .Where(spec.Criteria); Assert.Equal(expectedCount, result.Count()); }
public async Task <IEnumerable <Product> > GetAllProductItems(int productId) { var spec = new ProductByIdSpecification(productId); return(await _productRepository.ListAsync(spec)); }