public void GetNextLowestCostNeighbour_ReturnsNull_WhenStartItemNotFound(Node <string> startNode)
        {
            var testGraph = CreateWeightedTestGraph();

            var result = GraphFunctions.GetNextLowestCostNeighbour(testGraph, startNode);

            Assert.AreEqual(new ValueTuple <Node, int?>(null, null), result);
        }
        public void GetNextLowestCostNeighbour_ReturnsLowestNode_WhenStartNodeFound(int startNodeIndex, int[] searchedNodeIndexes, int expectedResultNodeIndex, int expectedResultWeight)
        {
            var testGraph = CreateWeightedTestGraph();
            ValueTuple <Node, int> expectedResult = new ValueTuple <Node, int>(testGraph.Nodes[expectedResultNodeIndex], expectedResultWeight);
            List <Node>            searchedNodes  = new List <Node>();

            foreach (var index in searchedNodeIndexes)
            {
                searchedNodes.Add(testGraph.Nodes[index]);
            }

            var result = GraphFunctions.GetNextLowestCostNeighbour(testGraph, testGraph.Nodes[startNodeIndex], searchedNodes);

            Assert.AreEqual(expectedResult, result);
        }
        public void GetNextLowestCostNeighbour_ThrowsNullArgumentException_WhenSearchItemIsNull()
        {
            Graph testGraph = new Graph(new List <Edge>(), new List <Node>());

            Assert.That(() => GraphFunctions.GetNextLowestCostNeighbour(testGraph, null), Throws.ArgumentNullException);
        }
        public void GetNextLowestCostNeighbour_ThrowsNullArgumentException_WhenGraphIsNull()
        {
            Graph testGraph = null;

            Assert.That(() => GraphFunctions.GetNextLowestCostNeighbour(testGraph, new Node <string>("Payload")), Throws.ArgumentNullException);
        }