public void MatchesExpectedNumberOfItems(int phoneBookId, int expectedCount)
        {
            var spec = new PhonebookByIdSpecification(phoneBookId);

            var result = GetTestItemCollection()
                         .AsQueryable()
                         .Where(spec.Criteria);

            Assert.Equal(expectedCount, result.Count());
        }
Пример #2
0
        public async Task <IEnumerable <PhoneBook> > GetAllPhoneBookItems(int phoneBookId)
        {
            var spec = new PhonebookByIdSpecification(phoneBookId);

            return(await _phoneBookRepository.ListAsync(spec));
        }