public async Task GetAll_ShouldReturn_PageItems() { //Arrange //Act var urlMapFilterInput = new UrlMapFilterInput() { Take = 2, Page = 2 }; var urlMapOutputs = await _tinyUrlService.GetAll(urlMapFilterInput); //Assert Assert.Equal(urlMapFilterInput.Take, urlMapOutputs.Items.Count); Assert.Equal(2, urlMapFilterInput.Skip); }
public async Task <IViewComponentResult> InvokeAsync(string sorting, int currentPage = 1, int take = 10) { var urlMapOutputs = await _tinyUrlService.GetAll(new UrlMapFilterInput() { Sorting = sorting, Page = currentPage, Take = take, }); return(View(urlMapOutputs)); }
public async Task OnGetAsync(string filter, int currentPage = 1, int pageSize = 10) { var input = new UrlMapFilterInput() { Filter = filter, Page = currentPage, Take = pageSize, }; Result = await _tinyUrlService.GetAll(input); CurrentPage = currentPage; TotalPages = (int)Math.Ceiling(decimal.Divide(Result.TotalCount, pageSize)); }
/// <summary> /// Gets all the url objects stored . /// </summary> public JsonResult GetAll() { return(Json(_service.GetAll())); }
public async Task <UrlMapPageOutput> Get([FromQuery] UrlMapFilterInput input) { return(await _tinyUrlService.GetAll(input)); }