Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
896c320a
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,发现更多精彩内容 >>
提交
896c320a
编写于
6月 28, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use simple usings
上级
51a5be4b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
83 addition
and
131 deletion
+83
-131
src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticLessAndGreaterThanCompletionTests.cs
...cCompletion/AutomaticLessAndGreaterThanCompletionTests.cs
+83
-131
未找到文件。
src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticLessAndGreaterThanCompletionTests.cs
浏览文件 @
896c320a
...
...
@@ -14,29 +14,23 @@ public class AutomaticLessAndGreaterThanCompletionTests : AbstractAutomaticBrace
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
public
void
Creation
()
{
using
(
var
session
=
CreateSession
(
"$$"
))
{
Assert
.
NotNull
(
session
);
}
using
var
session
=
CreateSession
(
"$$"
);
Assert
.
NotNull
(
session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
public
void
InvalidLocation_TopLevel
()
{
using
(
var
session
=
CreateSession
(
"$$"
))
{
Assert
.
NotNull
(
session
);
}
using
var
session
=
CreateSession
(
"$$"
);
Assert
.
NotNull
(
session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
public
void
InvalidLocation_TopLevel2
()
{
using
(
var
session
=
CreateSession
(
"using System;$$"
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
using
var
session
=
CreateSession
(
"using System;$$"
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -44,11 +38,9 @@ public void Class_TypeParameter()
{
var
code
=
@"class C$$"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -59,11 +51,9 @@ public void Method_TypeParameter()
void Method$$
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -71,12 +61,10 @@ public void Class_TypeParameter_Delete()
{
var
code
=
@"class C$$"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
CheckBackspace
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
CheckBackspace
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -84,12 +72,10 @@ public void Class_TypeParameter_Tab()
{
var
code
=
@"class C$$"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
CheckTab
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
CheckTab
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -97,12 +83,10 @@ public void Class_TypeParameter_GreaterThan()
{
var
code
=
@"class C$$"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
CheckOverType
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
CheckOverType
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -110,11 +94,9 @@ public void Multiple_Invalid()
{
var
code
=
@"class C<$$>"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -125,11 +107,9 @@ public void Multiple_Nested()
C<C$$>
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -143,11 +123,9 @@ void Method()
var b = i $$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -160,11 +138,9 @@ void Method()
var a = new List$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
AutomaticCompletion
)]
...
...
@@ -177,11 +153,9 @@ void Method()
var a = typeof(List$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WorkItem
(
531637
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/531637"
)]
...
...
@@ -192,13 +166,11 @@ public void TypeParameterReturnType()
{
List$$
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
[
WorkItem
(
531637
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/531637"
)]
...
...
@@ -209,13 +181,11 @@ public void TypeParameterInDecl()
{
void List$$
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"T"
);
CheckOverType
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"T"
);
CheckOverType
(
session
.
Session
);
}
[
WorkItem
(
531637
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/531637"
)]
...
...
@@ -226,13 +196,11 @@ public void TypeParameterInDeclWith()
{
async Task$$
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
[
WorkItem
(
530864
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530864"
)]
...
...
@@ -248,13 +216,11 @@ void Test()
List$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
[
WorkItem
(
530864
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530864"
)]
...
...
@@ -268,11 +234,9 @@ void Test()
List$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
[
WorkItem
(
1628
,
"https://github.com/dotnet/roslyn/issues/1628"
)]
...
...
@@ -287,11 +251,9 @@ void Test(int[] args)
var a = args[0]$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
[
WorkItem
(
1628
,
"https://github.com/dotnet/roslyn/issues/1628"
)]
...
...
@@ -306,11 +268,9 @@ void Test(object[] args, object[] other)
var a = args?.First()$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
,
expectValidSession
:
false
);
}
[
WorkItem
(
1628
,
"https://github.com/dotnet/roslyn/issues/1628"
)]
...
...
@@ -325,11 +285,9 @@ void Test(object[] args)
args?.OfType$$
}
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WorkItem
(
1628
,
"https://github.com/dotnet/roslyn/issues/1628"
)]
...
...
@@ -355,13 +313,11 @@ class Inner<V>
{
public void Method<X>() { }
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
Type
(
session
.
Session
,
"int"
);
CheckOverType
(
session
.
Session
);
}
[
WorkItem
(
1628
,
"https://github.com/dotnet/roslyn/issues/1628"
)]
...
...
@@ -395,11 +351,9 @@ internal class Inner
public Inner() { }
public void DoSomething<V>() { }
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
[
WorkItem
(
1628
,
"https://github.com/dotnet/roslyn/issues/1628"
)]
...
...
@@ -431,11 +385,9 @@ public class Inner
{
public void Method<U>() { }
}"
;
using
(
var
session
=
CreateSession
(
code
))
{
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
using
var
session
=
CreateSession
(
code
);
Assert
.
NotNull
(
session
);
CheckStart
(
session
.
Session
);
}
internal
Holder
CreateSession
(
string
code
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录