Exemplo n.º 1
0
        public void NodeGenerator_ProvideNodeCollection_ThrowsMaxValueNodeCount()
        {
            ResetState();
            Assert.Throws <ArgumentOutOfRangeException>(() =>
            {
                _generator.ProvideNodeCollection(_graph, UInt32.MaxValue);
            });

            _generator.ProvideNodeCollection(_graph, 3);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Fills graph with randomly generated data based on seleceted parameters.
 /// </summary>
 /// <param name="nodesCount">Amount of nodes to generate</param>
 /// <param name="maxNeighbours">Maximum number of neighbours per node</param>
 public void FillGraphRandomly(uint nodesCount, uint maxNeighbours)
 {
     if (!CanAdd())
     {
         throw new DataStructureLockedException("Filling graph with random nodes", GetType());
     }
     MaxNeigbhours = maxNeighbours;
     _nodeGenerator.ProvideNodeCollection(this, nodesCount, maxNeighbours);
     LockGraph();
 }