public void PutSiteUrl_ItemBelongsToUSer_ShouldUpdateIt() { var siteUrl = new SiteUrl { Id = "1", OsmUserId = "1" }; _israelHikingRepository.GetUrlById(siteUrl.Id).Returns(siteUrl); _controller.SetupIdentity(siteUrl.OsmUserId); var results = _controller.PutSiteUrl(siteUrl.Id, siteUrl).Result as OkObjectResult; Assert.IsNotNull(results); _israelHikingRepository.Received(1).Update(Arg.Any <SiteUrl>()); }
public void PostUserLayers_AuthorizedUser_ShouldUpdateUserLayers() { var osmUserId = "osmUserId"; _controller.SetupIdentity(osmUserId); var results = _controller.PostUserLayers(osmUserId, new UserLayers()).Result; Assert.IsNotNull(results as OkObjectResult); _israelHikingRepository.Received(1).UpdateUserLayers(osmUserId, Arg.Any <UserLayers>()); }