public async Task GetAllProducts() { var expectedProducts = GenerateProducts(3); _productRepository.Setup(mockRepo => mockRepo.ReadAllAsync()).ReturnsAsync(expectedProducts.Select(ToDal)); var actualProducts = await _productFunctionality.ReadAllAsync(); AssertProductsAreEqual(expectedProducts.ToList(), actualProducts.ToList()); }
public async Task <PageEnvelope <Product, string> > GetAllAsync() { var bllEnvelope = await _productFunctionality.ReadAllAsync(); var slEnvelope = new PageEnvelope <int> { PageInfo = bllEnvelope.PageInfo, Data = bllEnvelope.Data.Select(FromBll) }; return(slEnvelope); }