public async Task GetListTModelAsync_Success(QueryParameters <FakeEntity, int> queryParameters, IQueryable <FakeEntity> queryable, IQueryable <FakeEntity> countQueryable) { ValidateQueryParametersMemberData(queryable, countQueryable); // Arrange & Act & Assert ObjectAssert.ValueEquals(_fixture.DataMapper.Map <FakeModel>(_fixture.UnitOfWork.FakeEntityRepository.ProtectedQuery(queryParameters)).ToList(), await _fixture.UnitOfWork.FakeEntityRepository.GetListAsync <FakeModel>(_fixture.DataMapper, queryParameters)); }
public async Task GetPagedListTModelAsync_Success(QueryParameters <FakeEntity, int> queryParameters, IQueryable <FakeEntity> queryable, IQueryable <FakeEntity> countQueryable) { ValidateQueryParametersMemberData(queryable, countQueryable); if (queryParameters?.Page == null || queryParameters.Page.IsValid == false) { return; } // Arrange var pagedResultQuery = _fixture.UnitOfWork.FakeEntityRepository.ProtectedPagedResultQuery <FakeModel>(_fixture.DataMapper, queryParameters); var expectedPagedResult = new PagedResult <FakeModel> { PageIndex = queryParameters.Page.Index, PageSize = queryParameters.Page.Size, Items = pagedResultQuery.ToList(), TotalCount = _fixture.UnitOfWork.FakeEntityRepository.Count(queryParameters) }; // Act & Assert ObjectAssert.ValueEquals(expectedPagedResult, await _fixture.UnitOfWork.FakeEntityRepository.GetPagedListAsync <FakeModel>(_fixture.DataMapper, queryParameters)); }