public async Task Get_ShouldReturn_AItem() { //Arrange var urlMapFilterInput = new UrlMapFilterInput() { Take = 2, Page = 2 }; var urlMapOutputs = await _tinyUrlService.GetAll(urlMapFilterInput); var output = urlMapOutputs.Items.First(); //Act var urlMapOutput = await _tinyUrlService.Get(output.Id); //Assert Assert.NotNull(urlMapOutput); }
public async Task <IActionResult> OnGetAsync(string id) { if (id == null) { return(NotFound()); } var urlMapOutput = await _tinyUrlService.Get(id); UrlMap = new UrlMapInput() { Id = urlMapOutput.Id, Title = urlMapOutput.Title, Description = urlMapOutput.Description, RawUrl = urlMapOutput.RawUrl, }; if (UrlMap == null) { return(NotFound()); } return(Page()); }
public async Task <IViewComponentResult> InvokeAsync(string id) { var urlMapOutput = await _tinyUrlService.Get(id); return(View(urlMapOutput)); }
public async Task <UrlMapOutput> Get(string id) { return(await _tinyUrlService.Get(id)); }