public async Task CanPrepareProductsByTagModel()
        {
            var model = await _catalogModelFactory.PrepareProductsByTagModelAsync(_productTag, new CatalogPagingFilteringModel());

            model.Id.Should().Be(_productTag.Id);
            model.TagName.Should().Be(_productTag.Name);
            model.Products.Count.Should().Be(6);
        }
Esempio n. 2
0
        public virtual async Task <IActionResult> ProductsByTag(int productTagId, CatalogPagingFilteringModel command)
        {
            var productTag = await _productTagService.GetProductTagByIdAsync(productTagId);

            if (productTag == null)
            {
                return(InvokeHttp404());
            }

            var model = await _catalogModelFactory.PrepareProductsByTagModelAsync(productTag, command);

            return(View(model));
        }