public void MatchesExpectedNumberOfItems(int phoneBookId, int expectedCount) { var spec = new PhonebookByIdSpecification(phoneBookId); var result = GetTestItemCollection() .AsQueryable() .Where(spec.Criteria); Assert.Equal(expectedCount, result.Count()); }
public async Task <IEnumerable <PhoneBook> > GetAllPhoneBookItems(int phoneBookId) { var spec = new PhonebookByIdSpecification(phoneBookId); return(await _phoneBookRepository.ListAsync(spec)); }