public void GraphServerConstructorTest() { using (var GraphServer = new BifrostHTTPServer(new IPPort(8080)) { ServerName = "GraphServer v0.1" } as IBifrostHTTPServer) { GraphServer.CreateNewGraph("123"); Assert.IsNotNull(GraphServer); Assert.IsNotNull(GraphServer.ServerName); Assert.AreEqual("GraphServer v0.1", GraphServer.ServerName); var graphs = GraphServer.ToList(); Assert.IsNotNull(graphs); Assert.AreEqual(1, graphs.Count); var graph1 = graphs[0]; Assert.IsNotNull(graph1); Assert.IsNotNull(graph1.IdKey); Assert.IsNotNull(graph1.RevIdKey); Assert.AreEqual(123UL, graph1.Id); } }
public void AddPropertyGraphTest() { using (var GraphServer = new BifrostHTTPServer(new IPPort(8080)) { ServerName = "GraphServer v0.1" } as IBifrostHTTPServer) { GraphServer.CreateNewGraph("123"); var graph = GraphServer.CreateNewGraph("256"); Assert.IsNotNull(graph); Assert.IsNotNull(graph.IdKey); Assert.IsNotNull(graph.RevIdKey); Assert.AreEqual(256UL, graph.Id); var graphs = GraphServer.ToList(); Assert.IsNotNull(graphs); Assert.AreEqual(2, graphs.Count); var graphIds = (from _graph in graphs select _graph.Id).ToList(); Assert.IsTrue(graphIds.Contains("123")); Assert.IsTrue(graphIds.Contains("256")); } }
public void NewPropertyGraphTest() { using (var GraphServer = new BifrostHTTPServer(new IPPort(8080)) { ServerName = "GraphServer v0.1" } as IBifrostHTTPServer) { GraphServer.CreateNewGraph("123"); var graph = GraphServer.CreateNewGraph("512", "demo graph", g => g.SetProperty("hello", "world!")); Assert.IsNotNull(graph); Assert.IsNotNull(graph.IdKey); Assert.IsNotNull(graph.RevIdKey); Assert.AreEqual(512UL, graph.Id); Assert.IsTrue(graph.ContainsKey("hello")); Assert.IsTrue(graph.ContainsValue("world!")); Assert.IsTrue(graph.Contains("hello", "world!")); var graphs = GraphServer.ToList(); Assert.IsNotNull(graphs); Assert.AreEqual(2, graphs.Count); var graphIds = (from _graph in graphs select _graph.Id).ToList(); Assert.IsTrue(graphIds.Contains("123")); Assert.IsTrue(graphIds.Contains("512")); } }