示例#1
0
        static int Main(string[] args)
        {
            string configurationFilePath;
            string inputPath = "";

            if (args.Length != 2)
            {
                Console.WriteLine("Input Path not provided");
                return(-1);
            }
            configurationFilePath = args[0];
            inputPath             = args[1];
            if (Helper.CheckDirectoryExists(inputPath))
            {
                if (Helper.CheckFileExists(configurationFilePath))
                {
                    Console.WriteLine("Welcome to Static Analysis Tool");

                    IConfiguration toolsConfiguration     = new ToolsConfiguration(configurationFilePath);
                    var            toolsConfigurationList = toolsConfiguration.LoadConfiguration();

                    StaticAnalysisApplication staticAnalysis = new StaticAnalysisApplication(toolsConfigurationList);

                    int errorcode = staticAnalysis.Run(inputPath);
                    if (errorcode == -2)
                    {
                        return(-2);
                    }
                }
            }
            return(0);
        }
示例#2
0
        public void given_toolObjectList_when_toolInvoked_then_noExceptionExpected()
        {
            var            configurationFilepath = @"C:\Users\320050767\Source\Repos\G7CaseStudy13\StaticAnalyzer\ConfigurationLib\Configuration.xml";
            var            inputPath             = @"C:\Users\320050767\Source\Repos\G7CaseStudy13\StaticAnalyzer";
            IConfiguration toolsConfiguration    = new ToolsConfiguration(configurationFilepath);
            var            toolList       = toolsConfiguration.LoadConfiguration();
            var            staticAnalyzer = new StaticAnalysisApplication(toolList);

            staticAnalyzer.Run(inputPath);
        }
示例#3
0
        public void given_configurationToolList_when_objectCreated_then_validCountExpecetd()
        {
            var            configurationFilepath = @"C:\Users\320050767\Source\Repos\G7CaseStudy13\StaticAnalyzer\ConfigurationLib\Configuration.xml";
            IConfiguration toolsConfiguration    = new ToolsConfiguration(configurationFilepath);
            var            toolList           = toolsConfiguration.LoadConfiguration();
            var            staticAnalyzer     = new StaticAnalysisApplication(toolList);
            var            staticAnalyzerList = staticAnalyzer.ToolObjectList;
            var            expectedValue      = staticAnalyzerList.Count();
            var            actualValue        = 1;

            Assert.AreEqual(expectedValue, actualValue);
        }