CleanCart.Controllers.ShopCatalogController.Index C# (CSharp) Метод

Index() публичный Метод

public Index ( ) : System.Web.Mvc.ViewResult
Результат System.Web.Mvc.ViewResult
        public ViewResult Index()
        {
            var catalogItems = _shopCatalogService.ListCatalogItems();
            var viewModel = new ShopCatalogViewModel {CatalogItems = catalogItems};
            return View(viewModel);
        }

Usage Example

        public void IndexShouldRetrivedListItemsFromService()
        {
            var service = new Mock<IShopCatalogService>();
            var shopCatalogController = new ShopCatalogController(service.Object);

            shopCatalogController.Index();

            service.Verify(x => x.ListCatalogItems());
        }
All Usage Examples Of CleanCart.Controllers.ShopCatalogController::Index
ShopCatalogController