コード例 #1
0
        private static bool IsMethodWithNoReturn(MethodDeclarationSyntax method)
        {
            var type = TypeSyntaxService.GetTypeString(method.ReturnType);

            var result = type == "void" || type == "Task";

            return(result);
        }
コード例 #2
0
        private static List <UnitTestMethodParameterViewModel> GetMethodParamsViewModels(IEnumerable <ParameterSyntax> parameters)
        {
            var ctorParamList =
                parameters
                .Select
                (
                    x =>
                    new UnitTestMethodParameterViewModel
            {
                Type = TypeSyntaxService.GetTypeString(x.Type),
                Name = x.Identifier.Text
            }
                )
                .ToList();

            return(ctorParamList);
        }