Test Case Method Identifier
addEdge
Test Items
The purpose of these tests is to check if the edges are added correctly to the multigraph, that they exist and have a given id. It should also verify that it is possible to add multiple edges between two nodes and that the method used to connect two existing nodes with an edge is functioning properly.
Methods to be used: addNode(), addEdge(), getEdge(), getNode(), isDirected(), getEdgeCount(), getSourceNode(), getTargetNode(), getId(), getEdgeBetween().
Input Specification
Add object of MultiGraph class, three nodes and two edges between the three nodes. Also add two edges between the nodes (both using the first node as a source and the second node as a target).
Output Specification
Asset that the number of edges is correct. Assert that the method getNode() gives the correct object (node) passing the id of the node. Assert that the edge is not a directed edge. Assert that the left and right node of an edge equal to source and target. Assert that the added edge object is not null and that its id is the one assigned to it when adding it. Assert that the added edge object is returned when calling the getEdgeBetween() method between the two nodes.