Exemplo n.º 1
0
        public void OneVerticeGraphHasNoBridges()
        {
            var sut   = new BridgesInGraph();
            var graph = new UndirectedGraph(1);

            Assert.Empty(sut.GetBridges(graph));
        }
Exemplo n.º 2
0
        public void TwoVerticeGraphHasOneBridges()
        {
            var sut   = new BridgesInGraph();
            var graph = new UndirectedGraph(2);

            graph.Connect(0, 1);

            Assert.Collection(sut.GetBridges(graph), arg => Assert.Equal(new Tuple <int, int>(0, 1), arg));
        }
Exemplo n.º 3
0
        public void ThreeVerticeGraphHasNoBridges()
        {
            var sut   = new BridgesInGraph();
            var graph = new UndirectedGraph(3);

            graph.Connect(0, 1);
            graph.Connect(1, 2);
            graph.Connect(2, 0);

            Assert.Empty(sut.GetBridges(graph));
        }