public void GetSiteUrlForUser_ItemInDatabase_ShouldReturnItAccordingToFromat() { var id = "someId"; var list = new List <SiteUrl> { new SiteUrl { OsmUserId = id } }; _controller.SetupIdentity(id); _israelHikingRepository.GetUrlsByUser(id).Returns(list); var results = _controller.GetSiteUrlForUser().Result as OkObjectResult; Assert.IsNotNull(results); Assert.AreEqual(list.Count, (results.Value as List <SiteUrl>).Count); }
public async Task <IActionResult> GetSiteUrlForUser() { var siteUrls = await _repository.GetUrlsByUser(User.Identity.Name); return(Ok(siteUrls)); }