Ejemplo n.º 1
0
 public void AddDirectedEdge_ShouldThrowKeyNotFoundException_WhenNotExistingKeySpecified(DirectedGraph <int> graph, int source, int destination)
 {
     Assert.Throws <KeyNotFoundException>(() =>
     {
         graph.AddDirectedEdge(source, destination);
     });
 }
Ejemplo n.º 2
0
 public void AddDirectedEdge_ShouldThrowInvalidOperationException_WhenEdgeCreatesLoopOrMultipleEdge(DirectedGraph <int> graph, int source, int destination)
 {
     Assert.Throws <InvalidOperationException>(() =>
     {
         graph.AddDirectedEdge(source, destination);
     });
 }
Ejemplo n.º 3
0
        public void AddDirectedEdge_WithoutFromObject_ThrowsException()
        {
            var toValue   = "to";
            var fromValue = "from";

            _directedGraph.Add(toValue);

            Assert.Throws(typeof(KeyNotFoundException), () => _directedGraph.AddDirectedEdge(fromValue, toValue, 0));
        }