Пример #1
0
        public IEnumerable <(string name, object value)> ProvideProperties(ISymbol symbol)
        {
            if (symbol is IMethodSymbol methodSymbol)
            {
                foreach (var framework in TestFramework.GetFrameworks())
                {
                    if (framework.IsTestMethod(methodSymbol))
                    {
                        yield return("testFramework", framework.Name);

                        yield return("testMethodName", methodSymbol.GetMetadataName());
                    }
                }
            }
        }
Пример #2
0
        public IEnumerable <SyntaxFeature> Discover(SyntaxNode node, SemanticModel semanticModel)
        {
            if (node is MethodDeclarationSyntax method)
            {
                foreach (var framework in TestFramework.GetFrameworks())
                {
                    if (framework.IsTestMethod(method, semanticModel))
                    {
                        var methodName = semanticModel.GetDeclaredSymbol(method).GetMetadataName();

                        yield return(new SyntaxFeature
                        {
                            Name = framework.FeatureName,
                            Data = methodName
                        });
                    }
                }
            }
        }