Пример #1
0
        public string StaticAnalyserToolControllerAbsolute(string userName, string repositoryName, string acceptanceLevel)
        {
            int    numberOfLevelErrors, totalNumberOfIssues;
            bool   toCheckValidity, GoOrNoGo;
            string totalNumberOfIssuesString;

            string[] issuesArray;
            PredefinedAcceptedLevelsAbsoluteGating.ValidityOfUserInput checkValidity = new PredefinedAcceptedLevelsAbsoluteGating.ValidityOfUserInput();
            toCheckValidity = checkValidity.CheckValidityOfUserInput(acceptanceLevel);
            if (!toCheckValidity)
            {
                return("Invalid Acceptance Level.Acceptance Level is a string - Level1,Level2,..Level5");
            }

            totalNumberOfIssuesString = StaticAnalyserToolController(userName, repositoryName);
            issuesArray         = totalNumberOfIssuesString.Split(',');
            totalNumberOfIssues = Int32.Parse(issuesArray[0]) + Int32.Parse(issuesArray[1]);


            PredefinedAcceptedLevelsAbsoluteGating.AcceptedLevels acceptedLevels = new PredefinedAcceptedLevelsAbsoluteGating.AcceptedLevels();

            numberOfLevelErrors = acceptedLevels.dictionaryLevels[acceptanceLevel];

            FinalDecisionGatingParameter.FinalDecisionGatingParameter makeFinalDecision = new FinalDecisionGatingParameter.FinalDecisionGatingParameter();

            GoOrNoGo = makeFinalDecision.MakeFinalDecisionAbsoluteParameter(totalNumberOfIssues, numberOfLevelErrors);
            if (GoOrNoGo)
            {
                return("Go");
            }
            return("No Go");
        }
        public bool CheckValidityOfUserInput(string acceptableLevel)
        {
            AcceptedLevels acceptedLevels = new AcceptedLevels();

            if (acceptedLevels.dictionaryLevels.ContainsKey(acceptableLevel))
            {
                return(true);
            }
            return(false);
        }