public List <AdvertisementModel> Get1() { var adverts = _advertisementService.Get().Take(1); var data = new List <AdvertisementModel>(); foreach (var item in adverts) { data.Add(new AdvertisementModel() { Id = item.Id, Price = item.Price, Title = item.Title }); } return(data); }
public void AdvertisementsMethod() { Program.BuildConfiguration(); var data = AdvertisementService.Get(new TeamHttpContext(MockData.httpContext)); string result = data.Code == HttpStatusCode.OK ? "OK" : "ERROR"; Xunit.Assert.Equal("OK", result); }
public List <Advertisement> GetAll() { return(_advertisementService.Get()); }
public ActionResult <List <AdvertisementModel> > Get() { return(_advertisementService.Get()); }