Skip to content

Commit 5242d8d

Browse files
committed
Add tests for qualification of using alias directive
1 parent cbe1c79 commit 5242d8d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/OrderingRules/SA1200OutsideNamespaceUnitTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,14 @@ public async Task TestInvalidSimplifiedUsingStatementsInExtensionNamespaceAsync(
129129
{
130130
using System.Threading;
131131
using Reflection;
132+
using Assembly = Reflection.Assembly;
133+
using List = Collections.Generic.IList<int>;
132134
}
133135
";
134136
var fixedTestCode = @"using System.Reflection;
135137
using System.Threading;
138+
using Assembly = System.Reflection.Assembly;
139+
using List = System.Collections.Generic.IList<int>;
136140
137141
namespace System.MyExtension
138142
{
@@ -143,6 +147,8 @@ namespace System.MyExtension
143147
{
144148
this.CSharpDiagnostic(SA1200UsingDirectivesMustBePlacedCorrectly.DescriptorOutside).WithLocation(3, 5),
145149
this.CSharpDiagnostic(SA1200UsingDirectivesMustBePlacedCorrectly.DescriptorOutside).WithLocation(4, 5),
150+
this.CSharpDiagnostic(SA1200UsingDirectivesMustBePlacedCorrectly.DescriptorOutside).WithLocation(5, 5),
151+
this.CSharpDiagnostic(SA1200UsingDirectivesMustBePlacedCorrectly.DescriptorOutside).WithLocation(6, 5),
146152
};
147153

148154
await this.VerifyCSharpDiagnosticAsync(testCode, expectedResults, CancellationToken.None).ConfigureAwait(false);

0 commit comments

Comments
 (0)