Exemplo n.º 1
0
        public Core.Graph Generate()
        {
            var graph = new Core.Graph(_numberOfVertices);

            graph.Random(_probabilityOfEdgeExistence, _random.NextDouble);
            return(graph);
        }
Exemplo n.º 2
0
 public Graph Map(Core.Graph resource)
 {
     return(new Graph
     {
         IsTraversable = resource.IsTraversable,
         Path = resource.Path
     });
 }
Exemplo n.º 3
0
            public void ItShouldMapGraphCorrectly()
            {
                var graph = new Core.Graph
                {
                    IsTraversable = true,
                    Path          = new [] { 1, 3, 5, 7, 9 }
                };

                var response = Sut.Map(graph);

                response.IsTraversable.Should().Be(graph.IsTraversable);
                response.Path.Should().BeEquivalentTo(graph.Path);
            }