Exemplo n.º 1
0
        public string GateTicsReport(TicsInputRepoModel inputModel)
        {
            CodeMetricsSqldbRepository sqldbRepository      = new CodeMetricsSqldbRepository();
            TicsReportParser           ticsReportParser     = new TicsReportParser(sqldbRepository);
            GitRepositoryHandler       gitRepositoryHandler = new GitRepositoryHandler();
            TicsToolExecutor           ticsToolExecutor     = new TicsToolExecutor(ticsReportParser);
            string inputRepo = inputModel.gitRepo;

            ticsReportParser.Persist(inputRepo);
            gitRepositoryHandler.CloneGithubRepository(inputRepo);
            ticsToolExecutor.ExecuteTicsTool();
            int    ticsErrors = ticsToolExecutor.ParseReport();
            int    gatingStatusOnPreviousRun = ticsReportParser.GateOnPreviousRun(inputRepo);
            string result;

            if (gatingStatusOnPreviousRun == -1)
            {
                result = CheckGatingCondition(ticsErrors, inputModel.TicsErrorsThreshold);
            }
            else if (gatingStatusOnPreviousRun == 0)
            {
                result = CheckGatingCondition(ticsErrors, inputModel.TicsErrorsThreshold) + " Less Errors than Previous Run";
            }
            else
            {
                result = CheckGatingCondition(ticsErrors, inputModel.TicsErrorsThreshold) + " Same Or More Errors than Previous Run";
            }
            return(result);
        }
Exemplo n.º 2
0
 public void TestMethod1()
 {
     ticsExecutor.ExecuteTicsTool();
     Assert.IsTrue(File.Exists("C:\\Users\\320053937\\Documents\\TicsReport.txt"));
 }