-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UTs to test Razor Expressions locations #9224
Add UTs to test Razor Expressions locations #9224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just two code smells left.
analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/SymbolReferenceAnalyzerTest.cs
Outdated
Show resolved
Hide resolved
@@ -227,7 +227,7 @@ public void Verify_UnchangedFiles(string unchangedFileName, bool expectedProtobu | |||
orderedSymbols[0].FilePath.Should().EndWith("_Imports.razor"); | |||
orderedSymbols[1].FilePath.Should().EndWith("Razor.razor"); | |||
|
|||
VerifyReferences(orderedSymbols[1].Reference, 9, 13, 4, 6, 20); // currentCount | |||
VerifyReferences(orderedSymbols[1].Reference, 9, 13, 4, 6, 20, 48); // currentCount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the T0010 violation in line 223 by renaming symbol
to x
.
@@ -352,6 +357,10 @@ private VerifierBuilder CreateBuilder(ProjectType projectType, params string[] f | |||
.Should().BeEquivalentTo(assertedDeclarationLineReferences); | |||
} | |||
|
|||
private static void VerifyReferencesColumns(IReadOnlyList<SymbolReferenceInfo.Types.SymbolReference> symbolReference, int declarationLine, int startLine, int endLine, int startOffset, int endOffset) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates S103 and should be
private static void VerifyReferencesColumns(IReadOnlyList<SymbolReferenceInfo.Types.SymbolReference> symbolReference, int declarationLine, int startLine, int endLine, int startOffset, int endOffset) => | |
private static void VerifyReferencesColumns(IReadOnlyList<SymbolReferenceInfo.Types.SymbolReference> symbolReference, | |
int declarationLine, | |
int startLine, | |
int endLine, | |
int startOffset, | |
int endOffset) => |
Quality Gate passed for 'Sonar .NET Java Plugin'Issues Measures |
Quality Gate passed for 'SonarAnalyzer for .NET'Issues Measures |
No description provided.