Example #1
0
        public void Should_ReturnExpectNumberOfValues_When_SpecificFilterPassedIn(int skip, int take, string searchText, int expectedCount)
        {
            //Arrange
            var spec = new FilterPaginationSpecification(skip, take, searchText);

            //Act
            var result = GetTestItemCollection()
                         .AsQueryable()
                         .Where(spec.WhereExpressions.FirstOrDefault());

            //Assert
            result.Should().HaveCount(expectedCount);
        }
        public async Task <IReadOnlyList <Dashboard> > GetDashboard(string searchText, int page = 1, int pageSize = 25)
        {
            var spec = new FilterPaginationSpecification(page * pageSize, pageSize, searchText);

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