public void Service_Then_Can_GetAdvertisements() { // ARRANGE // ACT var entities = _service.GetAdvertisements(); // ASSERT Assert.IsTrue(entities.Any()); }
// GET: Advertisements public IActionResult Index(string titleFIlter) { //var advertisements = await _processor.GetAdvertisements<List<Advertisement>>(); var advertisements = advertService.GetAdvertisements(); if (!string.IsNullOrEmpty(titleFIlter)) { advertisements = advertisements.Where(x => x.Title.Contains(titleFIlter)).ToList(); } return(View(advertisements)); }
public IActionResult Index(int?pageNo, int?recordSize) { recordSize = recordSize.HasValue ? recordSize.Value : 10; ShopProductViewModel vm = new ShopProductViewModel() { Products = _productService.ListProduct(pageNo, recordSize.Value, out int count), Categories = _categoryService.GetCategories(), Advertisements = _advertisementService.GetAdvertisements(), PageSize = recordSize.Value, PageNo = pageNo, Blogs = _blogService.GetAllProducts() }; vm.Pager = new Pager(count, pageNo, recordSize.Value); return(View(vm)); }
public IEnumerable<Advertisement> GetAdvertisements() { return _service.GetAdvertisements(); }