Example #1
0
        private void Testing(OptimalEnum optimal)
        {
            try
            {
                testPath = ReaderWriter.ReaderWriter.CreateTestFile(testsDictionary[optimal]);

                reader = new ReaderWriter.ReaderGraph(testPath, false);
                graph  = reader.ReadFile();

                Optimal optimalAlgorithm = new Optimal(graph);
                optimalAlgorithm.Color();

                stringBuilder.AppendLine(optimal.ToString());
                stringBuilder.AppendLine("Graph colored.");
                stringBuilder.AppendLine(graph.GetColoredGraph().ToString());
            }
            catch (KeyNotFoundException)
            {
                throw new MyException.TestsException.TestsMissingTestException(optimal.ToString());
            }
            catch (MyException.ReaderWriterException.ReaderWriterException e)
            {
                stringBuilder.AppendLine(e.Message);
            }
        }
Example #2
0
        /// <summary>
        /// Test a particular enum (file)
        /// </summary>
        /// <returns>report</returns>
        public StringBuilder Test(OptimalEnum optimal)
        {
            stringBuilder.Clear();

            Testing(optimal);

            return(stringBuilder);
        }