Example #1
0
        public void GivenDifferentSyntaxTrees_GetDescendantNodes_ReturnsEmpty()
        {
            var first      = SyntaxFactory.ParseSyntaxTree("Dim a As String");
            var identifier = first.GetRoot().DescendantNodes().OfType <ModifiedIdentifierSyntax>().First();

            var second = SyntaxFactory.ParseSyntaxTree("Dim a As String");

            ISymbolExtensions.GetDescendantNodes(identifier.GetLocation(), second.GetRoot()).Should().BeEmpty();
        }
Example #2
0
        public void GivenMissingVariableDeclarator_GetDescendantNodes_ReturnsEmpty()
        {
            var tree = SyntaxFactory.ParseSyntaxTree(@"new FileSystemAccessRule(""User"", FileSystemRights.ListDirectory, AccessControlType.Allow)");

            ISymbolExtensions.GetDescendantNodes(tree.GetRoot().GetLocation(), tree.GetRoot()).Should().BeEmpty();
        }
Example #3
0
 public void GivenNullSourceTree_GetDescendantNodes_ReturnsEmpty() =>
 ISymbolExtensions.GetDescendantNodes(Location.None, SyntaxFactory.ModifiedIdentifier("a")).Should().BeEmpty();