Esempio n. 1
0
        public void EdgeExists()
        {
            var myGraph = new UndirectedWeightedGraph <int, EdgeData>();

            myGraph.AddNodes(1, 2, 3);
            myGraph.AddEdges(
                (1, 2, 4, dummyEdgeData),
                (2, 3, 5, dummyEdgeData)
                );

            myGraph.Exists(1, 2).Should().BeTrue();
            myGraph.Exists(2, 1).Should().BeTrue();
            myGraph.Exists(2, 3).Should().BeTrue();
            myGraph.Exists(3, 2).Should().BeTrue();
            myGraph.Exists(1, 3).Should().BeFalse();
            myGraph.Invoking(x => x.Exists(3, 4)).Should().Throw <ArgumentException>();
        }