public void AddDirectedEdge_ShouldThrowKeyNotFoundException_WhenNotExistingKeySpecified(DirectedGraph <int> graph, int source, int destination) { Assert.Throws <KeyNotFoundException>(() => { graph.AddDirectedEdge(source, destination); }); }
public void AddDirectedEdge_ShouldThrowInvalidOperationException_WhenEdgeCreatesLoopOrMultipleEdge(DirectedGraph <int> graph, int source, int destination) { Assert.Throws <InvalidOperationException>(() => { graph.AddDirectedEdge(source, destination); }); }
public void AddDirectedEdge_WithoutFromObject_ThrowsException() { var toValue = "to"; var fromValue = "from"; _directedGraph.Add(toValue); Assert.Throws(typeof(KeyNotFoundException), () => _directedGraph.AddDirectedEdge(fromValue, toValue, 0)); }