public void FindLowestCoseNode_ReturnsNull_WhenAllItemsAreInProcessedList()
        {
            var testNode1 = new Node <string>("A");
            var testNode2 = new Node <string>("B");
            var testNode3 = new Node <string>("C");
            var testNode4 = new Node <string>("D");
            var testNode5 = new Node <string>("E");

            var testDictionary = new Dictionary <Node, (uint, Node)>();

            testDictionary.Add(testNode1, (99, null));
            testDictionary.Add(testNode2, (99, null));
            testDictionary.Add(testNode3, (99, null));
            testDictionary.Add(testNode4, (99, null));
            testDictionary.Add(testNode5, (99, null));

            var testProcessedList = new List <Node>()
            {
                testNode1, testNode2, testNode3, testNode4, testNode5
            };

            var result = GraphFunctions.FindLowestCostNode(testDictionary, testProcessedList);

            Assert.AreEqual(null, result);
        }
        public void FindLowestCostNode_ThrowsNullArgumentException_WhenProcessedListIsNull()
        {
            var testDictionary = new Dictionary <Node, (uint, Node)>();

            testDictionary.Add(new Node <string>("B"), (99, null));
            List <Node> testProcessedList = null;

            Assert.That(() => GraphFunctions.FindLowestCostNode(testDictionary, testProcessedList), Throws.ArgumentNullException);
        }
        public void FindLowestCostNode_ThrowsNullArgumentException_WhenDictionaryIsNull()
        {
            Dictionary <Node, ValueTuple <uint, Node> > testDictionary = null;
            var testProcessedList = new List <Node>()
            {
            };

            Assert.That(() => GraphFunctions.FindLowestCostNode(testDictionary, testProcessedList), Throws.ArgumentNullException);
        }
        public void FindLowestCostNode_ThrowsArgumentException_WhenDictionaryIsEmpty()
        {
            var testDictionary = new Dictionary <Node, (uint, Node)>()
            {
            };
            var testProcessedList = new List <Node>()
            {
            };

            Assert.That(() => GraphFunctions.FindLowestCostNode(testDictionary, testProcessedList), Throws.ArgumentException);
        }
        public void FindLowestCoseNode_ReturnsFirstNode_WhenAllWeightsAreEqual()
        {
            var testNode       = new Node <string>("A");
            var testDictionary = new Dictionary <Node, (uint, Node)>();

            testDictionary.Add(testNode, (99, null));
            testDictionary.Add(new Node <string>("B"), (99, null));
            testDictionary.Add(new Node <string>("C"), (99, null));
            testDictionary.Add(new Node <string>("D"), (99, null));
            testDictionary.Add(new Node <string>("E"), (99, null));
            var testProcessedList = new List <Node>()
            {
            };

            var result = GraphFunctions.FindLowestCostNode(testDictionary, testProcessedList);

            Assert.AreEqual(testNode, result);
        }