public ActionResult Map() { var mapRepository = new MapRepository(); var map = mapRepository.GetById(1); return(Json(map, JsonRequestBehavior.AllowGet)); }
public async Task Can_store_and_retrieve_map() { var repository = new MapRepository(_documentClient, DatabaseId); var mapId = "testmap-" + DateTime.Now.ToString("u"); var map = new Map(mapId, new Node("a"), new Node("b")); map.AddEdge("a", "b", 5); var result1 = await repository.Create(map); Assert.Equal(map, result1); var result2 = await repository.GetById(mapId); Assert.NotNull(result2); Assert.Equal(mapId, result2.Id); Assert.Contains("a", result2.Nodes.Keys); Assert.Contains("b", result2.Nodes.Keys); Assert.Equal(5, result2.Nodes["a"].Edges[0].Distance); }