public void GetProducts() { var products = new ProductBuilder().GetProducts(1); _mockRepository.Setup(x => x.GetAll()).Returns(products.AsQueryable()); var customersFromRepo = _service.GetAll(); Assert.True(customersFromRepo.Count == 1); }
// GET: Shop public ActionResult Index(int categoryid = 0, int colorid = 0, string name = "") { ViewBag.category = category.GetAll(); ViewBag.colors = color.GetAll(); if (categoryid != 0) { return(View(product.GetProductsByCategory(categoryid))); } if (colorid != 0) { return(View(product.GetProductsByColor(colorid))); } return(View(product.GetAll())); }
public ActionResult Index() { IEnumerable <Product> products = productAppService.GetAll(); return(View(products)); }
// GET: Client_Product/Create public ActionResult Create() { ViewBag.ClientId = new SelectList(_clientAppService.GetAll(), "ClientId", "Name"); ViewBag.ProductId = new SelectList(_productAppService.GetAll(), "ProductId", "Name"); return(View()); }
public async Task <IEnumerable <ProductDto> > Get() { return(await _productAppService.GetAll()); }
public async Task <ActionResult> ProductList() { var productdtos = await _productAppService.GetAll(); return(View(new ProductListViewModel(productdtos))); }