Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
08d58e0b
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
08d58e0b
编写于
5月 04, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Unify on a single test helper.
上级
1e6e8178
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
36 deletion
+36
-36
src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb
...RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb
+36
-36
未找到文件。
src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb
浏览文件 @
08d58e0b
...
...
@@ -45,7 +45,7 @@ End Module|]")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestNoImports
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -61,7 +61,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestNoImportsWithCopyright
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|' Copyright (c) Somebody.
Imports System
...
...
@@ -83,7 +83,7 @@ End Module")
<
WorkItem
(
27006
,
"https://github.com/dotnet/roslyn/issues/27006"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestReferencesWithCopyrightAndGroupings
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|' Copyright (c) Somebody.
Imports System.Collections.Generic
...
...
@@ -111,7 +111,7 @@ End Module")
<
WorkItem
(
27006
,
"https://github.com/dotnet/roslyn/issues/27006"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestReferencesWithCopyrightAndPreservableTrivia
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|' Copyright (c) Somebody.
Imports System.Collections.Generic
...
...
@@ -140,7 +140,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestSimpleTypeName
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -159,7 +159,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestGenericTypeName
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -178,7 +178,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestNamespaceName
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -197,7 +197,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestAliasName
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -217,7 +217,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestExtensionMethod
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -236,7 +236,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestModuleMember
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Imports System.Linq
...
...
@@ -268,7 +268,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestInvalidCodeRemovesImports
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Imports System.Collections.Generic
Module Program
...
...
@@ -288,7 +288,7 @@ End Module")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestExcludedCodeIsIgnored
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System
Module Program
Sub Main()
...
...
@@ -309,7 +309,7 @@ End Module")
<
WorkItem
(
541744
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541744"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestCommentsAroundImportsStatement
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
'c1
[|
Imports
System.Configuration
'c2
Imports
System
,
System
.
Collections
.
Generic
'c3
...
...
@@ -373,7 +373,7 @@ End Class|]")
<
WorkItem
(
541757
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541757"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImportsSurroundedByDirectives
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"#If True Then
[|Imports System.Collections.Generic
#End If
...
...
@@ -388,7 +388,7 @@ End Module")
<
WorkItem
(
541758
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541758"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemovingUnbindableImports
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports gibberish
Module Program
End Module|]"
,
...
...
@@ -399,7 +399,7 @@ End Module")
<
WorkItem
(
541744
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541744"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestPreservePrecedingComments
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
' c1
[|
Imports
System
'c2
' C3
...
...
@@ -416,7 +416,7 @@ End Module</Text>.NormalizedValue)
<
WorkItem
(
541757
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541757"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestDirective1
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
#If True Then
[|
Imports
System.Collections.Generic
#End If
...
...
@@ -433,7 +433,7 @@ End Module</Text>.NormalizedValue)
<
WorkItem
(
541757
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541757"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestDirective2
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
#If True Then
[|
Imports
System
Imports
System.Collections.Generic
...
...
@@ -454,7 +454,7 @@ End Module</Text>.NormalizedValue)
<
WorkItem
(
541932
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541932"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImportsClauseRemoval1
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System, goo, System.Collections.Generic
Module Program
Sub Main(args As String())
...
...
@@ -482,7 +482,7 @@ End Namespace")
<
WorkItem
(
541932
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541932"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImportsClauseRemoval2
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System, System.Collections.Generic, goo
Module Program
Sub Main(args As String())
...
...
@@ -509,7 +509,7 @@ End Namespace")
<
WorkItem
(
541932
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541932"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImportsClauseRemoval3
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports goo, System, System.Collections.Generic
Module Program
Sub Main(args As String())
...
...
@@ -537,7 +537,7 @@ End Namespace")
<
WorkItem
(
541758
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541758"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestUnbindableNamespace
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports gibberish
Module Program
End Module|]"
,
...
...
@@ -548,7 +548,7 @@ End Module")
<
WorkItem
(
541780
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541780"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemoveClause
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System, goo, System.Collections.Generic
Module Program
Sub Main(args As String())
...
...
@@ -576,7 +576,7 @@ End Namespace")
<
WorkItem
(
528603
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528603"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemoveClauseWithExplicitLC1
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports A _
, B
Module Program
...
...
@@ -610,7 +610,7 @@ End Namespace")
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemoveClauseWithExplicitLC2
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports B _
, A
Module Program
...
...
@@ -645,7 +645,7 @@ End Namespace")
<
WorkItem
(
528603
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528603"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemoveClauseWithExplicitLC3
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
A
_
,
B
_
,
C
...
...
@@ -698,7 +698,7 @@ End Namespace</Text>.NormalizedValue)
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestTypeImports
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
Goo
Module
Program
...
...
@@ -743,7 +743,7 @@ End Class|]</Text>.NormalizedValue)
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestAlias
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
F
=
SomeNS
Module
Program
...
...
@@ -787,7 +787,7 @@ End Namespace|]</Text>.NormalizedValue)
<
WorkItem
(
16488
,
"DevDiv_Projects/Roslyn"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImportsOnSameLine1
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
A
:
Imports
B
Module
Program
...
...
@@ -826,7 +826,7 @@ End Namespace</Text>.NormalizedValue)
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImportsOnSameLine2
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
A
:
Imports
B
Imports
C
...
...
@@ -910,7 +910,7 @@ End Class|]") 'TODO (tomat): modules not yet supported in script
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestUnusedTypeImportIsRemoved
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
SomeNS.Goo
Module
Program
...
...
@@ -1012,7 +1012,7 @@ End Class|]</Text>.NormalizedValue)
<
WorkItem
(
542132
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542132"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemoveSuperfluousNewLines1
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
>
[|
Imports
System
Imports
System.Collections.Generic
Imports
System.Linq
...
...
@@ -1032,7 +1032,7 @@ End Module</Text>.NormalizedValue)
<
WorkItem
(
542132
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542132"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemoveSuperfluousNewLines2
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
><
!
[
CDATA
[[|
Imports
System
Imports
System.Collections.Generic
Imports
System.Linq
...
...
@@ -1059,7 +1059,7 @@ End Module]]></Text>.NormalizedValue)
<
WorkItem
(
542895
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542895"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRegressionFor10326
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
"[|Imports System.ComponentModel
<Goo(GetType(Category))>
Class Category
...
...
@@ -1108,7 +1108,7 @@ diagnosticId:=IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId)
<
WorkItem
(
712656
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/712656"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestRemovalSpan4
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
text
>
#Const
A
=
1
Imports
System
...
...
@@ -1125,7 +1125,7 @@ Class C : Dim x As Action : End Class</text>.NormalizedValue)
<
WorkItem
(
545831
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545831"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsRemoveUnnecessaryImports
)
>
Public
Async
Function
TestImplicitElementAtOrDefault
()
As
Task
Await
TestInRegularAndScriptAsync
(
Await
TestInRegularAndScript
1
Async
(
<
Text
><
!
[
CDATA
[[|
Option Strict On
Imports
System
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录