Esempio n. 1
0
        private void Testing(SaturationLargestFirstSequenceEnum saturationLargestFirstSequence)
        {
            try
            {
                testPath = ReaderWriter.ReaderWriter.CreateTestFile(testsDictionary[saturationLargestFirstSequence]);

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

                SaturationLargestFirstSequence saturationLargestFirstSequenceAlgorithm = new SaturationLargestFirstSequence(graph);
                saturationLargestFirstSequenceAlgorithm.Color();

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

            Testing(saturationLargestFirstSequence);

            return(stringBuilder);
        }