示例#1
0
        private IEnumerable <SolutionStyleError> InspectMethod(LocalFunctionStatementSyntax method)
        {
            var name = method?.Identifier.Text;

            if (name == null || method.AttributeLists.Any())
            {
                yield break;
            }
            if (method.AttributeLists.Any())
            {
                yield break;                 // Turn this check off for [Test], [TestCase] and all other special cases marked with attribute
            }
            if (method.IsVoidGetter() && !method.AttributeLists.Any())
            {
                yield return(new SolutionStyleError(StyleErrorType.NamingStyle01, method.Identifier));
            }
            if (method.IsNoArgsSetter())
            {
                yield return(new SolutionStyleError(StyleErrorType.NamingStyle02, method.Identifier));
            }
            if (name.IsSingleWordGerundIdentifier())
            {
                yield return(new SolutionStyleError(StyleErrorType.NamingStyle03, method.Identifier));
            }
            if (name.IsSingleWordIonIdentifier())
            {
                yield return(new SolutionStyleError(StyleErrorType.NamingStyle04, method.Identifier));
            }
        }