public async Task <IHttpActionResult> Get(string sortOrder, string search, int?page = 1, int?pageSize = 10) { int pageSize2 = pageSize ?? 10; if (pageSize2 > 40) { pageSize2 = 40; } int pageNo = (page ?? 1); Page <Bike> bikeList = await _bikeService.GetBikes(sortOrder, search, new PageParams() { PageNo = pageNo, PageSize = pageSize2 }); return(base.Ok(bikeList)); }
public void GetBikes_Calls_GetAll_In_Repo() { bikeService.GetBikes(); mockRepo.Verify(r => r.GetAll(), Times.Once); }
public IActionResult GetBikes() { return(Ok(_bikeService.GetBikes())); }
public IActionResult Get() { var result = _bikeService.GetBikes(); return(Ok(result)); }
public void GetBikesTest() { _bikeService.AddBike("1", 0.2m); Assert.AreEqual(1, _bikeService.GetBikes().Count); }
public IActionResult GetBikes() { return(Ok(_mapper.Map <IEnumerable <BikeIndexResource> >(_bikeService.GetBikes()))); }