Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b61d04d1
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,发现更多精彩内容 >>
提交
b61d04d1
编写于
11月 20, 2015
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make more tests async.
上级
fab93a0f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
18 addition
and
18 deletion
+18
-18
src/EditorFeatures/CSharpTest/ExtractMethod/ExtractMethodBase.cs
...torFeatures/CSharpTest/ExtractMethod/ExtractMethodBase.cs
+1
-1
src/EditorFeatures/CSharpTest/Organizing/OrganizeUsingsTests.cs
...itorFeatures/CSharpTest/Organizing/OrganizeUsingsTests.cs
+1
-1
src/EditorFeatures/CSharpTest/Outlining/MetadataAsSource/InvalidIdentifierTests.cs
...Test/Outlining/MetadataAsSource/InvalidIdentifierTests.cs
+1
-1
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
...ures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
+2
-2
src/EditorFeatures/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs
...res/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs
+6
-6
src/EditorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.Delegate.cs
...res/CSharpTest/TypeInferrer/TypeInferrerTests.Delegate.cs
+2
-2
src/EditorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.cs
...itorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.cs
+2
-2
src/EditorFeatures/Test/QuickInfo/AbstractQuickInfoSourceTests.cs
...orFeatures/Test/QuickInfo/AbstractQuickInfoSourceTests.cs
+2
-2
src/Workspaces/VisualBasicTest/CodeGeneration/AddImportsTests.vb
...kspaces/VisualBasicTest/CodeGeneration/AddImportsTests.vb
+1
-1
未找到文件。
src/EditorFeatures/CSharpTest/ExtractMethod/ExtractMethodBase.cs
浏览文件 @
b61d04d1
...
...
@@ -110,7 +110,7 @@ protected async Task NotSupported_ExtractMethodAsync(string codeWithMarker)
var
semanticDocument
=
await
SemanticDocument
.
CreateAsync
(
document
,
CancellationToken
.
None
);
var
validator
=
new
CSharpSelectionValidator
(
semanticDocument
,
testDocument
.
SelectedSpans
.
Single
(),
options
);
var
selectedCode
=
validator
.
GetValidSelectionAsync
(
CancellationToken
.
None
).
Result
;
var
selectedCode
=
await
validator
.
GetValidSelectionAsync
(
CancellationToken
.
None
)
;
if
(!
succeed
&&
selectedCode
.
Status
.
FailedWithNoBestEffortSuggestion
())
{
return
null
;
...
...
src/EditorFeatures/CSharpTest/Organizing/OrganizeUsingsTests.cs
浏览文件 @
b61d04d1
...
...
@@ -17,7 +17,7 @@ protected async Task CheckAsync(string initial, string final, bool specialCaseSy
using
(
var
workspace
=
await
CSharpWorkspaceFactory
.
CreateWorkspaceFromFileAsync
(
initial
))
{
var
document
=
workspace
.
CurrentSolution
.
GetDocument
(
workspace
.
Documents
.
First
().
Id
);
var
newRoot
=
OrganizeImportsService
.
OrganizeImportsAsync
(
document
,
specialCaseSystem
).
Result
.
GetSyntaxRootAsync
().
Result
;
var
newRoot
=
await
(
await
OrganizeImportsService
.
OrganizeImportsAsync
(
document
,
specialCaseSystem
)).
GetSyntaxRootAsync
()
;
Assert
.
Equal
(
final
.
NormalizeLineEndings
(),
newRoot
.
ToFullString
());
}
}
...
...
src/EditorFeatures/CSharpTest/Outlining/MetadataAsSource/InvalidIdentifierTests.cs
浏览文件 @
b61d04d1
...
...
@@ -21,7 +21,7 @@ private async Task TestAsync(string fileContents, params OutliningSpan[] expecte
var
workspace
=
await
TestWorkspaceFactory
.
CreateWorkspaceFromFilesAsync
(
WorkspaceKind
.
MetadataAsSource
,
LanguageNames
.
CSharp
,
null
,
null
,
fileContents
);
var
outliningService
=
workspace
.
Services
.
GetLanguageServices
(
LanguageNames
.
CSharp
).
GetService
<
IOutliningService
>();
var
document
=
workspace
.
CurrentSolution
.
Projects
.
Single
().
Documents
.
Single
();
var
actualOutliningSpans
=
outliningService
.
GetOutliningSpansAsync
(
document
,
CancellationToken
.
None
).
Result
.
Where
(
s
=>
s
!=
null
).
ToArray
();
var
actualOutliningSpans
=
(
await
outliningService
.
GetOutliningSpansAsync
(
document
,
CancellationToken
.
None
))
.
Where
(
s
=>
s
!=
null
).
ToArray
();
Assert
.
Equal
(
expectedSpans
.
Length
,
actualOutliningSpans
.
Length
);
for
(
int
i
=
0
;
i
<
expectedSpans
.
Length
;
i
++)
...
...
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
浏览文件 @
b61d04d1
...
...
@@ -114,7 +114,7 @@ private async Task VerifyWithMscorlib45Async(string markup, Action<object>[] exp
workspace
.
GetService
<
IGlyphService
>(),
workspace
.
GetService
<
ClassificationTypeMap
>());
var
state
=
provider
.
GetItemAsync
(
document
,
position
,
cancellationToken
:
CancellationToken
.
None
).
Result
;
var
state
=
await
provider
.
GetItemAsync
(
document
,
position
,
cancellationToken
:
CancellationToken
.
None
)
;
if
(
state
!=
null
)
{
WaitForDocumentationComment
(
state
.
Content
);
...
...
@@ -271,7 +271,7 @@ private async Task VerifyWithReferenceWorkerAsync(string xmlString, params Actio
workspace
.
GetService
<
IGlyphService
>(),
workspace
.
GetService
<
ClassificationTypeMap
>());
var
state
=
provider
.
GetItemAsync
(
document
,
position
,
cancellationToken
:
CancellationToken
.
None
).
Result
;
var
state
=
await
provider
.
GetItemAsync
(
document
,
position
,
cancellationToken
:
CancellationToken
.
None
)
;
if
(
state
!=
null
)
{
WaitForDocumentationComment
(
state
.
Content
);
...
...
src/EditorFeatures/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs
浏览文件 @
b61d04d1
...
...
@@ -286,16 +286,16 @@ private IQuickInfoProvider CreateProvider(TestWorkspace workspace)
workspace
.
GetService
<
ClassificationTypeMap
>());
}
protected
override
void
AssertNoContent
(
protected
override
async
Task
AssertNoContentAsync
(
TestWorkspace
workspace
,
Document
document
,
int
position
)
{
var
provider
=
CreateProvider
(
workspace
);
Assert
.
Null
(
provider
.
GetItemAsync
(
document
,
position
,
CancellationToken
.
None
).
Result
);
Assert
.
Null
(
await
provider
.
GetItemAsync
(
document
,
position
,
CancellationToken
.
None
)
);
}
protected
override
void
AssertContentIs
(
protected
override
async
Task
AssertContentIsAsync
(
TestWorkspace
workspace
,
Document
document
,
int
position
,
...
...
@@ -303,7 +303,7 @@ private IQuickInfoProvider CreateProvider(TestWorkspace workspace)
string
expectedDocumentationComment
=
null
)
{
var
provider
=
CreateProvider
(
workspace
);
var
state
=
provider
.
GetItemAsync
(
document
,
position
,
cancellationToken
:
CancellationToken
.
None
).
Result
;
var
state
=
await
provider
.
GetItemAsync
(
document
,
position
,
cancellationToken
:
CancellationToken
.
None
)
;
Assert
.
NotNull
(
state
);
var
viewHostingControl
=
(
ViewHostingControl
)((
ElisionBufferDeferredContent
)
state
.
Content
).
Create
();
...
...
@@ -347,11 +347,11 @@ protected override Task TestInScriptAsync(string code, string expectedContent, s
if
(
string
.
IsNullOrEmpty
(
expectedContent
))
{
AssertNoContent
(
workspace
,
document
,
position
);
await
AssertNoContentAsync
(
workspace
,
document
,
position
);
}
else
{
AssertContentIs
(
workspace
,
document
,
position
,
expectedContent
,
expectedDocumentationComment
);
await
AssertContentIsAsync
(
workspace
,
document
,
position
,
expectedContent
,
expectedDocumentationComment
);
}
}
}
...
...
src/EditorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.Delegate.cs
浏览文件 @
b61d04d1
...
...
@@ -19,11 +19,11 @@ private async Task TestDelegateAsync(string text, string expectedType)
Document
document
=
await
fixture
.
UpdateDocumentAsync
(
text
,
SourceCodeKind
.
Regular
);
var
root
=
document
.
GetSyntaxTreeAsync
().
Result
.
GetRoot
();
var
root
=
(
await
document
.
GetSyntaxTreeAsync
())
.
GetRoot
();
var
node
=
FindExpressionSyntaxFromSpan
(
root
,
textSpan
);
var
typeInference
=
document
.
GetLanguageService
<
ITypeInferenceService
>();
var
delegateType
=
typeInference
.
InferDelegateType
(
document
.
GetSemanticModelAsync
().
Result
,
node
,
CancellationToken
.
None
);
var
delegateType
=
typeInference
.
InferDelegateType
(
await
document
.
GetSemanticModelAsync
()
,
node
,
CancellationToken
.
None
);
Assert
.
NotNull
(
delegateType
);
Assert
.
Equal
(
expectedType
,
delegateType
.
ToNameDisplayString
());
...
...
src/EditorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.cs
浏览文件 @
b61d04d1
...
...
@@ -27,8 +27,8 @@ protected override async Task TestWorkerAsync(Document document, TextSpan textSp
var
typeInference
=
document
.
GetLanguageService
<
ITypeInferenceService
>();
var
inferredType
=
useNodeStartPosition
?
typeInference
.
InferType
(
document
.
GetSemanticModelForSpanAsync
(
new
TextSpan
(
node
?.
SpanStart
??
textSpan
.
Start
,
0
),
CancellationToken
.
None
).
Result
,
node
?.
SpanStart
??
textSpan
.
Start
,
objectAsDefault
:
true
,
cancellationToken
:
CancellationToken
.
None
)
:
typeInference
.
InferType
(
document
.
GetSemanticModelForSpanAsync
(
node
?.
Span
??
textSpan
,
CancellationToken
.
None
).
Result
,
node
,
objectAsDefault
:
true
,
cancellationToken
:
CancellationToken
.
None
);
?
typeInference
.
InferType
(
await
document
.
GetSemanticModelForSpanAsync
(
new
TextSpan
(
node
?.
SpanStart
??
textSpan
.
Start
,
0
),
CancellationToken
.
None
)
,
node
?.
SpanStart
??
textSpan
.
Start
,
objectAsDefault
:
true
,
cancellationToken
:
CancellationToken
.
None
)
:
typeInference
.
InferType
(
await
document
.
GetSemanticModelForSpanAsync
(
node
?.
Span
??
textSpan
,
CancellationToken
.
None
)
,
node
,
objectAsDefault
:
true
,
cancellationToken
:
CancellationToken
.
None
);
var
typeSyntax
=
inferredType
.
GenerateTypeSyntax
();
Assert
.
Equal
(
expectedType
,
typeSyntax
.
ToString
());
}
...
...
src/EditorFeatures/Test/QuickInfo/AbstractQuickInfoSourceTests.cs
浏览文件 @
b61d04d1
...
...
@@ -44,12 +44,12 @@ protected async Task TestInMethodAndScriptAsync(string code, string expectedCont
string
expectedDocumentationComment
=
null
,
CSharpParseOptions
parseOptions
=
null
);
protected
abstract
void
AssertNoContent
(
protected
abstract
Task
AssertNoContentAsync
(
TestWorkspace
workspace
,
Document
document
,
int
position
);
protected
abstract
void
AssertContentIs
(
protected
abstract
Task
AssertContentIsAsync
(
TestWorkspace
workspace
,
Document
document
,
int
position
,
...
...
src/Workspaces/VisualBasicTest/CodeGeneration/AddImportsTests.vb
浏览文件 @
b61d04d1
...
...
@@ -38,7 +38,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Editting
Dim
doc
=
GetDocument
(
initialText
,
globalImports
)
options
=
If
(
options
,
doc
.
Project
.
Solution
.
Workspace
.
Options
)
Dim
imported
=
ImportAdder
.
AddImportsAsync
(
doc
,
options
).
Result
Dim
imported
=
Await
ImportAdder
.
AddImportsAsync
(
doc
,
options
)
If
importsAddedText
IsNot
Nothing
Then
Dim
formatted
=
Await
Formatter
.
FormatAsync
(
imported
,
SyntaxAnnotation
.
ElasticAnnotation
,
options
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录