| 83 | }); |
| 84 | |
| 85 | function assertGraphsAreSame(expected, actual,t) { |
| 86 | t.equals(expected.getNodesCount(), actual.getNodesCount(), 'Number of nodes does not match for graph: ' + expected.Name); |
| 87 | t.equals(expected.getLinksCount(), actual.getLinksCount(), 'Number of links does not match for graph: ' + expected.Name); |
| 88 | |
| 89 | expected.forEachNode(function(node) { |
| 90 | t.ok(actual.getNode(node.id), 'Actual graph is missing node with id: ' + node.id); |
| 91 | }); |
| 92 | |
| 93 | expected.forEachLink(function(link) { |
| 94 | t.ok(actual.hasLink(link.fromId, link.toId), 'Actual graph is missing link from ' + link.fromId + ' to ' + link.toId); |
| 95 | }); |
| 96 | } |