Microsoft.CodeAnalysis.Sarif.Converters.AndroidStudioConverter.GetShortDescriptionForProblem C# (CSharp) 메소드

GetShortDescriptionForProblem() 공개 정적인 메소드

Generates a user-facing description for a problem, using the description supplied at construction time if it is present; otherwise, generates a description from the problem type.
public static GetShortDescriptionForProblem ( AndroidStudioProblem problem ) : string
problem AndroidStudioProblem The problem.
리턴 string
        public static string GetShortDescriptionForProblem(AndroidStudioProblem problem)
        {
            string desc = problem.Description;
            if (desc == null)
            {
                return String.Format(CultureInfo.InvariantCulture, ConverterResources.AndroidStudioDescriptionUnknown, problem.ProblemClass);
            }

            return desc;
        }

Usage Example

        public void AndroidStudioConverter_GetShortDescription_UsesProblemClassIfDescriptionNotPresent()
        {
            var    uut    = AndroidStudioProblemTests.GetDefaultProblem();
            string result = AndroidStudioConverter.GetShortDescriptionForProblem(uut);

            result.Should().Contain("A Problematic Problem");
        }
All Usage Examples Of Microsoft.CodeAnalysis.Sarif.Converters.AndroidStudioConverter::GetShortDescriptionForProblem