Skip to content

Commit 6e0ec0c

Browse files
Simplify test assertions using Single() and removing redundant checks
Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
1 parent 8566ad4 commit 6e0ec0c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Compilers/VisualBasic/Test/Semantic/DeclaringSyntaxNodeTests.vb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,7 @@ End Class
671671
Assert.Equal(SymbolKind.Local, localSymbol.Kind)
672672
Assert.Equal("exc", localSymbol.Name)
673673

674-
Dim declaringRefs = localSymbol.DeclaringSyntaxReferences
675-
Assert.Equal(1, declaringRefs.Length)
676-
677-
Dim declaredSyntax = declaringRefs(0).GetSyntax()
678-
Assert.NotNull(declaredSyntax)
674+
Dim declaredSyntax = localSymbol.DeclaringSyntaxReferences.Single().GetSyntax()
679675
Assert.IsType(Of IdentifierNameSyntax)(declaredSyntax)
680676
Assert.Equal("exc", DirectCast(declaredSyntax, IdentifierNameSyntax).Identifier.ValueText)
681677
End Sub

0 commit comments

Comments
 (0)