private bool IsExpandableProperty(string code) { var document = CreateDocument(code); var property = document.GetSyntaxRootAsync().Result.DescendantNodes().OfType <PropertyDeclarationSyntax>().First(); return(ExpansionChecker.GetExpandablePropertyInfo(property, document.GetSemanticModelAsync().Result) != null); }
public void TryGetAccessors4() { const string Code = "class C { int P { get; set; }"; var property = SyntaxFactory.ParseCompilationUnit(Code).DescendantNodes().OfType <PropertyDeclarationSyntax>().First(); AccessorDeclarationSyntax getter; AccessorDeclarationSyntax setter; var result = ExpansionChecker.TryGetAccessors(property, out getter, out setter); Assert.True(result); }