private IList <WeightAndNodes> GetExpectedWeightAndNodes(string expectedResult) { string[] paths = Regex.Split(expectedResult.Trim(), @"[\n\r]+"); System.Collections.Generic.IList <WeightAndNodes> wnList = new System.Collections.Generic.List <WeightAndNodes>(); foreach (string path in paths) { Console.WriteLine("will split path string " + path); string[] weightAndNodes = Regex.Split(path.Trim(), @"\s"); double weight = double.Parse(weightAndNodes[0]); System.Collections.Generic.IList <int> nodess = new System.Collections.Generic.List <int>(); for (int i = 1; i < weightAndNodes.Length; i++) { Console.WriteLine("weightAndNodes[i] : " + weightAndNodes[i]); int node = int.Parse(weightAndNodes[i]); nodess.Add(node); } var ww = new WeightAndNodes(weight, nodess); wnList.Add(ww); Console.WriteLine(ww); } return(wnList); }
private void assertExpectedPath(WeightAndNodes expectedPath, Path actualPath) { Assert.AreEqual(expectedPath.Weight, actualPath.GetWeight(), SMALL_DELTA_VALUE_FOR_ASSERTIONS); assertVertexList(expectedPath.Nodes, actualPath.GetVertexList()); }