public void GivenStoreSitesWhenSearchThenReturnProducts()
        {
            var name     = "vga to hdmi";
            var products = _storeSiteAggregation.SearchAll("hdmi").ToList();
            var product  = products.First();

            Assert.Equal(product.Name, name);
        }
Exemple #2
0
        public ProductsReadDto Search(string keyword)
        {
            var productItems    = _storeSiteAggregation.SearchAll(keyword).OrderBy(product => product.Order);
            var products        = _mapper.Map <IEnumerable <ProductReadDto> >(productItems).ToList();
            var productsReadDto = new ProductsReadDto(products);

            productsReadDto.TotalResults = products.Count;
            return(productsReadDto);
        }