Skip to content

Commit 77c3341

Browse files
0x084Evweijsters
authored andcommitted
fixed failing tests for SA1135
1 parent 94afc4a commit 77c3341

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1135UnitTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ namespace System.Threading
3232

3333
DiagnosticResult[] expected =
3434
{
35-
this.CSharpDiagnostic().WithLocation(4, 5),
36-
this.CSharpDiagnostic().WithLocation(4, 5),
37-
this.CSharpDiagnostic().WithLocation(5, 5),
38-
this.CSharpDiagnostic().WithLocation(5, 5)
35+
this.CSharpDiagnostic().WithLocation(4, 5).WithArguments("System.IO"),
36+
this.CSharpDiagnostic().WithLocation(4, 5).WithArguments("System.IO"),
37+
this.CSharpDiagnostic().WithLocation(5, 5).WithArguments("System.Threading.Tasks"),
38+
this.CSharpDiagnostic().WithLocation(5, 5).WithArguments("System.Threading.Tasks")
3939
};
4040

4141
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
@@ -61,10 +61,10 @@ namespace System.Threading
6161

6262
DiagnosticResult[] expected =
6363
{
64-
this.CSharpDiagnostic().WithLocation(4, 5),
65-
this.CSharpDiagnostic().WithLocation(4, 5),
66-
this.CSharpDiagnostic().WithLocation(5, 5),
67-
this.CSharpDiagnostic().WithLocation(5, 5)
64+
this.CSharpDiagnostic().WithLocation(4, 5).WithArguments("System.IO"),
65+
this.CSharpDiagnostic().WithLocation(4, 5).WithArguments("System.IO"),
66+
this.CSharpDiagnostic().WithLocation(5, 5).WithArguments("System.Threading.Tasks"),
67+
this.CSharpDiagnostic().WithLocation(5, 5).WithArguments("System.Threading.Tasks")
6868
};
6969

7070
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
@@ -90,10 +90,10 @@ namespace System.Threading
9090

9191
DiagnosticResult[] expected =
9292
{
93-
this.CSharpDiagnostic().WithLocation(4, 5),
94-
this.CSharpDiagnostic().WithLocation(4, 5),
95-
this.CSharpDiagnostic().WithLocation(5, 5),
96-
this.CSharpDiagnostic().WithLocation(5, 5)
93+
this.CSharpDiagnostic().WithLocation(4, 5).WithArguments("System.IO.Path"),
94+
this.CSharpDiagnostic().WithLocation(4, 5).WithArguments("System.IO.Path"),
95+
this.CSharpDiagnostic().WithLocation(5, 5).WithArguments("System.Threading.Tasks.Task"),
96+
this.CSharpDiagnostic().WithLocation(5, 5).WithArguments("System.Threading.Tasks.Task")
9797
};
9898

9999
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);

StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/SA1135UsingDirectivesMustBeQualified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static void CheckUsingDeclaration(SyntaxNodeAnalysisContext context, Usi
6262
{
6363
string usingString = usingDirective.Name.ToString();
6464

65-
// Check for global qualified namepsaces.
65+
// Check for global qualified namespaces.
6666
if (usingString.IndexOf("::", StringComparison.Ordinal) < 0)
6767
{
6868
SymbolInfo symbolInfo = context.SemanticModel.GetSymbolInfo(usingDirective.Name, context.CancellationToken);

0 commit comments

Comments
 (0)