public async Task FoundFactsBasedTest(string projectName, string filename, int line, int column, bool found) { var sampleProject = TestsContext.Default.GetTestSample(projectName); var workspace = WorkspaceHelper.Create(sampleProject).FirstOrDefault(); var docId = workspace.CurrentSolution.GetDocumentIdsWithFilePath(Path.Combine(sampleProject, filename)).First(); var doc = workspace.CurrentSolution.GetDocument(docId); var root = await doc.GetSyntaxRootAsync(); var text = await doc.GetTextAsync(); var semanticModel = await doc.GetSemanticModelAsync(); var position = text.Lines.GetPosition(new LinePosition(line, column)); var syntaxNode = root.DescendantNodes() .OfType <MethodDeclarationSyntax>() .Single(node => node.Span.Contains(position)); var symbol = semanticModel.GetDeclaredSymbol(syntaxNode); var discover = new TestFeaturesDiscover(); var features = discover.Discover(syntaxNode, await doc.GetSemanticModelAsync()); if (found) { var feature = features.Single(); Assert.Equal("XunitTestMethod", feature.Name); var symbolName = symbol.ToDisplayString(); symbolName = symbolName.Substring(0, symbolName.IndexOf('(')); Assert.Equal(symbolName, feature.Data); } else { Assert.Empty(features); } }