public void GetItemsReturnsAlist() { //Act List <MenuItem> result; //Arrange result = menuRepo.GetItems(); //Assert Assert.IsType <List <MenuItem> >(result); }
/// <summary> /// This non-webapi method is used for both the PB Menu controller /// and the module's menu list controller /// </summary> /// <returns></returns> public List <ItemViewModel> GetItemList(int moduleId, string cultureCode) { List <ItemViewModel> items = _repository.GetItems(moduleId) .Select(item => new ItemViewModel(item, cultureCode, _noImageFile)) .ToList(); return(items); }
public HttpResponseMessage GetList() { List <ItemViewModel> items; if (Globals.IsEditMode()) { items = _repository.GetItems(ActiveModule.ModuleID) .Select(item => new ItemViewModel(item, GetCultureCode(), GetEditUrl(item.MenuItemId))) .ToList(); } else { items = _repository.GetItems(ActiveModule.ModuleID) .Select(item => new ItemViewModel(item, GetCultureCode(), "")) .ToList(); } return(Request.CreateResponse(HttpStatusCode.OK, items)); }
public ActionResult Index() { string culSetting = "en-US"; var items = _menuDataRepository.GetItems(CurrentModuleId); if (ModuleContext.Settings.ContainsKey("RestaurantMenu_CurrencyCulture")) { if (!String.IsNullOrEmpty(ModuleContext.Settings["RestaurantMenu_CurrencyCulture"].ToString())) { culSetting = ModuleContext.Settings["RestaurantMenu_CurrencyCulture"].ToString(); } } ViewBag.Culture = new CultureInfo(culSetting); return(View(items)); }
public IActionResult Index() { return(View(_menuItemRepository.GetItems())); }