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()); } } } }
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 }); } } } }