public void UnitBellmanFord()
        {
            BellmanFord newShortPath = new BellmanFord();

            newShortPath.Nodes        = new List <Node>();
            newShortPath.Edges        = new List <Edge>();
            newShortPath.PosNodeStart = 0;
            newShortPath.MaxValue     = 9999;
            for (int i = 1; i < 6; i++)
            {
                Node a = new Node();
                //a.Value = 0;
                a.Value = i;
                newShortPath.Nodes.Add(a);
            }

            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[0], B = newShortPath.Nodes[1], Weight = 6
            });
            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[0], B = newShortPath.Nodes[3], Weight = 7
            });

            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[1], B = newShortPath.Nodes[2], Weight = 5
            });
            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[1], B = newShortPath.Nodes[3], Weight = 8
            });
            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[1], B = newShortPath.Nodes[4], Weight = -4
            });

            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[2], B = newShortPath.Nodes[1], Weight = -2
            });

            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[4], B = newShortPath.Nodes[2], Weight = 7
            });
            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[4], B = newShortPath.Nodes[0], Weight = 2
            });

            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[3], B = newShortPath.Nodes[4], Weight = 9
            });
            newShortPath.Edges.Add(new Edge()
            {
                A = newShortPath.Nodes[3], B = newShortPath.Nodes[2], Weight = -3
            });

            string result      = "";
            bool   okNoCyleNeg = newShortPath.BellmanFordWork();

            if (okNoCyleNeg)
            {
                for (int i = 0; i < newShortPath.Nodes.Count; i++)
                {
                    result += newShortPath.Nodes[i].Value;
                    bool ok = true;
                    while (ok)
                    {
                        if (newShortPath.Nodes[i].parent != null)
                        {
                            result += newShortPath.Nodes[i].parent.Value;
                            newShortPath.Nodes[i] = newShortPath.Nodes[i].parent;
                        }
                        else
                        {
                            ok = false;
                        }
                    }
                }
            }
            Assert.AreEqual("0247047070-22470", result);
        }