Exemple #1
0
        //This cannot be a dictionary because the strings have to change after a change in the selected language.
        private static string ResultMessage(CaseInspectionResultType resultType)
        {
            switch (resultType)
            {
            case CaseInspectionResultType.Unreachable:
                return(InspectionResults.UnreachableCaseInspection_Unreachable);

            case CaseInspectionResultType.InherentlyUnreachable:
                return(InspectionResults.UnreachableCaseInspection_InherentlyUnreachable);

            case CaseInspectionResultType.MismatchType:
                return(InspectionResults.UnreachableCaseInspection_TypeMismatch);

            case CaseInspectionResultType.Overflow:
                return(InspectionResults.UnreachableCaseInspection_Overflow);

            case CaseInspectionResultType.CaseElse:
                return(InspectionResults.UnreachableCaseInspection_CaseElse);

            default:
                throw new ArgumentOutOfRangeException(nameof(resultType), resultType, null);
            }
        }
Exemple #2
0
 private IInspectionResult CreateInspectionResult(QualifiedContext <VBAParser.SelectCaseStmtContext> selectStmt, ParserRuleContext unreachableBlock, CaseInspectionResultType resultType)
 {
     return(CreateInspectionResult(selectStmt, unreachableBlock, ResultMessage(resultType)));
 }