/// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> ProductEmailAFriend(int productId)
        {
            var product = await _productService.GetProductByIdAsync(productId);

            if (product == null || product.Deleted || !product.Published || !_catalogSettings.EmailAFriendEnabled)
            {
                return(RedirectToRoute("Homepage"));
            }

            var model = new ProductEmailAFriendModel();

            model = await _productModelFactory.PrepareProductEmailAFriendModelAsync(model, product, false);

            return(View(model));
        }
        public async Task CanPrepareProductEmailAFriendModel()
        {
            var product = await _productService.GetProductByIdAsync(1);

            var model = await _productModelFactory.PrepareProductEmailAFriendModelAsync(new ProductEmailAFriendModel(), product, false);

            model.ProductId.Should().Be(product.Id);
            model.ProductName.Should().Be(product.Name);
            model.ProductSeName.Should().Be(await GetService <IUrlRecordService>().GetSeNameAsync(product));
            model.YourEmailAddress.Should().Be(NopTestsDefaults.AdminEmail);
        }