public void CorrectCircuitLength(string inputFile, string outputFile) { (var num, var data) = SalesmanCalculator2.LoadData(inputFile); var distance = SalesmanCalculator2.ShortestCircuit(num, data); var output = File.ReadAllLines(outputFile).WhereNotNull().Select(int.Parse).First(); Assert.AreEqual(output, distance); }
static void Main(string[] args) { (var num, var data) = SalesmanCalculator2.LoadData("tsp2_data.txt"); Console.WriteLine("Data loaded"); var distance = SalesmanCalculator2.ShortestCircuit(num, data); Console.WriteLine(distance); }
// [Test, TestCaseSource(typeof(TestCaseFactory), "TSP2Cases")] public void CanLoadSets(string inputFile, string outputFile) { (var num, var data) = SalesmanCalculator2.LoadData(inputFile); Assert.AreEqual(num, data.Count); }