예제 #1
0
        public void ShouldCountAllSimpleCyclesWhenGivenSourceNodeAndMaxStops(string igraph, char isourceNode, int imaxStops, int expectedCycleCount)
        {
            //Arrange
            var graph = GraphLoaderHelper.LoadGraphFromString(igraph);
            var sut   = new CycleOperations <char>();

            //Act
            var actual = sut.FindAllSimpleCycles(graph, isourceNode, imaxStops);

            //Assert
            Assert.AreEqual(expectedCycleCount, actual.Count);
        }
예제 #2
0
        public void ShouldCountAllSimpleCycles(string igraph, int expectedCycleCount)
        {
            //Arrange
            var graph = GraphLoaderHelper.LoadGraphFromString(igraph);
            var sut   = new CycleOperations <char>();

            //Act
            var actual = sut.FindAllSimpleCycles(graph);

            //Assert
            Assert.AreEqual(expectedCycleCount, actual.Count);
        }