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

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

                CombinationAlgorithm combinationAlgorithm = new CombinationAlgorithm(graph);
                combinationAlgorithm.Color();

                stringBuilder.AppendLine(combinationAlgorithm.ToString());
                stringBuilder.AppendLine("Graph colored.");
                stringBuilder.AppendLine(graph.GetColoredGraph().ToString());
            }
            catch (KeyNotFoundException)
            {
                throw new MyException.TestsException.TestsMissingTestException(combination.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(CombinationEnum combination)
        {
            stringBuilder.Clear();

            Testing(combination);

            return(stringBuilder);
        }