Beispiel #1
0
        private void Testing(ChordalTestEnum chordalEnum)
        {
            try
            {
                testPath = ReaderWriter.ReaderWriter.CreateTestFile(testsDictionary[chordalEnum]);

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

                stringBuilder.AppendLine(chordalEnum.ToString());
                stringBuilder.AppendLine("Graph created.");
                stringBuilder.AppendLine(graph.ToString());

                stringBuilder.AppendLine("isChordal " + graph.GetGraphProperty().GetIsChordal());

                foreach (IVertexInterface vertex in graph.GetGraphProperty().GetPerfectEliminationOrdering())
                {
                    stringBuilder.AppendLine("- " + vertex.GetIdentifier());
                }
            }
            catch (KeyNotFoundException)
            {
                throw new MyException.TestsException.TestsMissingTestException(chordalEnum.ToString());
            }
            catch (MyException.ReaderWriterException.ReaderWriterException e)
            {
                stringBuilder.AppendLine(e.Message);
            }
            catch (MyException.GraphException.GraphIsNotConnected e)
            {
                stringBuilder.AppendLine(e.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Test a particular enum (file)
        /// </summary>
        /// <param name="chordalEnum">enum (file)</param>
        /// <returns>report</returns>
        public StringBuilder Test(ChordalTestEnum chordalEnum)
        {
            stringBuilder.Clear();

            Testing(chordalEnum);

            return(stringBuilder);
        }