Пример #1
0
        public Core.Graph Generate()
        {
            var graph = new Core.Graph(_numberOfVertices);

            graph.Random(_probabilityOfEdgeExistence, _random.NextDouble);
            return(graph);
        }
Пример #2
0
 public Graph Map(Core.Graph resource)
 {
     return(new Graph
     {
         IsTraversable = resource.IsTraversable,
         Path = resource.Path
     });
 }
Пример #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);
            }