public void UpdateEdges_Test() { var service = new CsvGraphDataService(); bool callSuccess = false; Exception er; List <DataEdge> list = new List <DataEdge>(); var item1 = new DataVertex(1); var item2 = new DataVertex(2); var edge1 = new DataEdge(item1, item2); list.Add(edge1); service.UpdateEdges(list, (sucess, error) => { er = error; callSuccess = sucess; }); DataEdge item1FromSource = null; service.GetEdges((data) => { item1FromSource = data.FirstOrDefault(); callSuccess = true; }, (e) => { }); Assert.IsTrue(callSuccess); Assert.IsNotNull(item1FromSource); Assert.AreEqual(edge1.Source.Id, item1FromSource.Source.Id); Assert.AreEqual(edge1.Target.Id, item1FromSource.Target.Id); }
public void GetEdges_From_File_Test() { var service = new CsvGraphDataService(); bool callSuccess = false; bool callFail = false; List <DataEdge> resultData = null; service.GetEdges((data) => { callSuccess = true; resultData = new List <DataEdge>(data); }, (e) => { callFail = true; }); Assert.IsFalse(callFail); Assert.IsTrue(callSuccess); Assert.IsNotNull(resultData); }
public void GetEdges_From_File_Test() { var service = new CsvGraphDataService(); bool callSuccess = false; bool callFail = false; List<DataEdge> resultData = null; service.GetEdges((data) => { callSuccess = true; resultData = new List<DataEdge>(data); }, (e) => { callFail = true; }); Assert.IsFalse(callFail); Assert.IsTrue(callSuccess); Assert.IsNotNull(resultData); }
public void UpdateEdges_Test() { var service = new CsvGraphDataService(); bool callSuccess = false; Exception er; List<DataEdge> list = new List<DataEdge>(); var item1 = new DataVertex(1); var item2 = new DataVertex(2); var edge1 = new DataEdge(item1, item2); list.Add(edge1); service.UpdateEdges(list, (sucess, error) => { er = error; callSuccess = sucess; }); DataEdge item1FromSource = null; service.GetEdges((data) => { item1FromSource = data.FirstOrDefault(); callSuccess = true; }, (e) => { }); Assert.IsTrue(callSuccess); Assert.IsNotNull(item1FromSource); Assert.AreEqual(edge1.Source.Id, item1FromSource.Source.Id); Assert.AreEqual(edge1.Target.Id, item1FromSource.Target.Id); }