private void Testing(ConnectedSequentialEnum connectedSequential) { try { testPath = ReaderWriter.ReaderWriter.CreateTestFile(testsDictionary[connectedSequential]); reader = new ReaderWriter.ReaderGraph(testPath, false); graph = reader.ReadFile(); ConnectedSequential optimalAlgorithm = new ConnectedSequential(graph); optimalAlgorithm.Color(); stringBuilder.AppendLine(connectedSequential.ToString()); stringBuilder.AppendLine("Graph colored."); stringBuilder.AppendLine(graph.GetColoredGraph().ToString()); } catch (KeyNotFoundException) { throw new MyException.TestsException.TestsMissingTestException(connectedSequential.ToString()); } catch (MyException.ReaderWriterException.ReaderWriterException e) { stringBuilder.AppendLine(e.Message); } }
/// <summary> /// Test a particular enum (file) /// </summary> /// <param name="connectedSequential">enum (file)</param> /// <returns>report</returns> public StringBuilder Test(ConnectedSequentialEnum connectedSequential) { stringBuilder.Clear(); Testing(connectedSequential); return(stringBuilder); }