public void GetEdgeInfo() { var vertex1 = new TestVertex("1"); var vertex2 = new TestVertex("2"); var edge = new Edge <TestVertex>(vertex1, vertex2); var graph = new AdjacencyGraph <TestVertex, Edge <TestVertex> >(); var algorithm1 = new TestSimpleLayoutAlgorithm(graph); Assert.IsNull(algorithm1.GetEdgeInfo(edge)); var algorithm2 = new TestComplexLayoutAlgorithm(graph); Assert.IsNull(algorithm2.GetEdgeInfo(edge)); graph.AddVerticesAndEdge(edge); Assert.IsNull(algorithm2.GetEdgeInfo(edge)); const double edgeInfo = 1.2; algorithm2.EdgesInfos.Add(edge, edgeInfo); Assert.AreEqual(edgeInfo, algorithm2.GetEdgeInfo(edge)); algorithm2.EdgesInfos.Remove(edge); Assert.IsNull(algorithm2.GetEdgeInfo(edge)); }
public void GetEdgeInfo_Throws() { // ReSharper disable ReturnValueOfPureMethodIsNotUsed // ReSharper disable AssignNullToNotNullAttribute var graph = new AdjacencyGraph <TestVertex, Edge <TestVertex> >(); var algorithm1 = new TestSimpleLayoutAlgorithm(graph); Assert.Throws <ArgumentNullException>(() => algorithm1.GetEdgeInfo(null)); var algorithm2 = new TestComplexLayoutAlgorithm(graph); Assert.Throws <ArgumentNullException>(() => algorithm2.GetEdgeInfo(null)); // ReSharper restore AssignNullToNotNullAttribute // ReSharper restore ReturnValueOfPureMethodIsNotUsed }