public void MatchesAllCatalogItems() { var catalogItemIds = new int[] { 1, 3 }; var spec = new eShopWeb.ApplicationCore.Specifications.CatalogItemsSpecification(catalogItemIds); var result = GetTestCollection() .AsQueryable() .Where(spec.WhereExpressions.FirstOrDefault().Filter); Assert.NotNull(result); Assert.Equal(2, result.ToList().Count); }
public void MatchesSpecificCatalogItem() { var catalogItemIds = new int[] { 1 }; var spec = new eShopWeb.ApplicationCore.Specifications.CatalogItemsSpecification(catalogItemIds); var result = GetTestCollection() .AsQueryable() .Where(spec.WhereExpressions.FirstOrDefault()); Assert.NotNull(result); Assert.Single(result.ToList()); }