public void GetLayers_ShouldGetThem() { var layers = new List <MapLayerData> { new MapLayerData() }; var osmUser = "******"; _controller.SetupIdentity(null, osmUser); _repository.GetUserLayers(osmUser).Returns(layers); var result = _controller.GetUserLayers().Result as OkObjectResult; Assert.IsNotNull(result); var returnedUserLayers = result.Value as List <MapLayerData>; Assert.IsNotNull(returnedUserLayers); Assert.AreEqual(layers.Count, returnedUserLayers.Count); }
public void GetLayers_ShouldGetThem() { var userLayers = new UserLayers { Layers = new List <UserLayerData> { new UserLayerData() } }; var osmUser = "******"; _controller.SetupIdentity(osmUser); _israelHikingRepository.GetUserLayers(osmUser).Returns(userLayers); var result = _controller.GetUserLayers().Result as OkObjectResult; Assert.IsNotNull(result); var returnedUserLayers = result.Value as UserLayers; Assert.IsNotNull(returnedUserLayers); Assert.AreEqual(returnedUserLayers.Layers.Count, userLayers.Layers.Count); }