Beispiel #1
0
        public bool doTest()
        {
            Console.WriteLine();
            ReqDisplay.title("Req #8 - An automated unit test suite");
            ReqDisplay.message(message);
            string[] args = new string[] { "../../../DemoExecutive/SpecialTestCases/" };
            DemoExecutive.ShowCommandLine(args);
            List <string> files = DemoExecutive.ProcessCommandline(args);
            Repository    repo  = new Repository();

            repo.semi = Factory.create();
            DemoExecutive.BuildTypeTable(args, files, repo);
            Display.showTypeTable(repo.typeTable);
            Console.WriteLine();
            Display.showAliasTable(repo.aliasTable);
            Console.WriteLine();
            DemoExecutive.depAnalysis(args, files, repo);
            Console.Write("\n\nDependency Analysis:");
            Display.showDependency(repo.depGraph);
            Console.Write("\n");
            var strongComponents = TarjanSccSolver.DetectCycle(repo.depGraph);

            Display.showStrongComponents(strongComponents);
            return(true);
        }
Beispiel #2
0
        public bool doTest()
        {
            Console.WriteLine();
            ReqDisplay.title("Req #6 - Find all strong components in the file collection");
            ReqDisplay.message("- In this program, Tarjan Algorithm is used to solve strong components.");

            string[] args = new string[] { "../../../DemoExecutive/Test/" };
            DemoExecutive.ShowCommandLine(args);
            List <string> files = DemoExecutive.ProcessCommandline(args);

            Repository repo = new Repository();

            repo.semi = Factory.create();

            BuildTypeAnalyzer builder = new BuildTypeAnalyzer(repo);
            Parser            parser  = builder.build();

            DemoExecutive.BuildTypeTable(args, files, repo);
            DemoExecutive.depAnalysis(args, files, repo);

            Console.Write("\n\nDependency Analysis:");
            Display.showDependency(repo.depGraph);

            Console.Write("\n");
            var strongComponents = TarjanSccSolver.DetectCycle(repo.depGraph);

            Display.showStrongComponents(strongComponents);

            return(true);
        }
        public static List <string> ProcessCommandline(string[] args)
        {
            List <string> files = new List <string>();

            if (args.Length < 1)
            {
                Console.Write("\n  Please enter path to analyze\n\n");
                return(files);
            }
            string path = args[0];

            if (!Directory.Exists(path))
            {
                Console.Write("\n  invalid path \"{0}\"", Path.GetFullPath(path));
                return(files);
            }
            path  = Path.GetFullPath(path);
            files = DemoExecutive.findFiles(path, "*.cs");

            return(files);
        }
Beispiel #4
0
        public bool doTest()
        {
            Console.WriteLine();
            ReqDisplay.title("Req #4 - Support specifying all C# files in a sub-directory");
            ReqDisplay.message("- This program supports specifying the collection as all C# files " +
                               "\n    in a sub-directory tree, rooted at a specified path." +
                               "\n  - usage:  [a specified directory path]");


            string[] args = new string[] { "../../../DemoExecutive/Test/" };
            DemoExecutive.ShowCommandLine(args);
            List <string> files = DemoExecutive.ProcessCommandline(args);

            foreach (string file in files)
            {
                Console.Write("\n  Processing file {0}", Path.GetFileName(file));
            }

            Console.WriteLine();
            return(true);
        }
Beispiel #5
0
        public bool doTest()
        {
            Console.WriteLine();
            ReqDisplay.title("Req #5 - Identify the user-defined types in the specified set of files");
            ReqDisplay.message("- This program could dentify all of the Types defined within that code, " +
                               "\n    e.g., interfaces, classes, structs, enums, and delegates.");


            string[] args = new string[] { "../../../DemoExecutive/Test/" };
            DemoExecutive.ShowCommandLine(args);
            List <string> files = DemoExecutive.ProcessCommandline(args);

            Repository repo = new Repository();

            repo.semi = Factory.create();

            DemoExecutive.BuildTypeTable(args, files, repo);

            Display.showTypeTable(repo.typeTable);
            Console.WriteLine();
            Display.showAliasTable(repo.aliasTable);
            Console.WriteLine();
            return(true);
        }