-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d0fe741
commit 55a795b
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
sonaranalyzer-dotnet/tests/SonarAnalyzer.UnitTest/TestCases/UseUriInsteadOfString.CSharp9.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
S3994 p = new("www.sonarsource.com"); // Compliant - FN | ||
|
||
string GetUrl(string url) => ""; // Compliant - FN | ||
|
||
public record S3994 | ||
{ | ||
public S3994(string uri) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}} | ||
|
||
public S3994(string uri, bool blah) { } // Noncompliant {{Either change this parameter type to 'System.Uri' or provide an overload which takes a 'System.Uri' parameter.}} | ||
|
||
public virtual string Url { get; set; } // Noncompliant {{Change this property type to 'System.Uri'.}} | ||
// ^^^^^^ | ||
} |