提交 09b95abf 编写于 作者: C Cyrus Najmabadi

Remove blocking calls from tests.

上级 ae8dbe3c
...@@ -1010,7 +1010,7 @@ class Program $$: ISomeInterface<object> ...@@ -1010,7 +1010,7 @@ class Program $$: ISomeInterface<object>
{ {
using (var testState = await ExtractInterfaceTestState.CreateAsync(markup, LanguageNames.CSharp, compilationOptions: null)) using (var testState = await ExtractInterfaceTestState.CreateAsync(markup, LanguageNames.CSharp, compilationOptions: null))
{ {
var result = testState.GetTypeAnalysisResult(typeDiscoveryRule); var result = await testState.GetTypeAnalysisResultAsync(typeDiscoveryRule);
Assert.Equal(expectedExtractable, result.CanExtractInterface); Assert.Equal(expectedExtractable, result.CanExtractInterface);
} }
} }
......
...@@ -67,13 +67,13 @@ public TestExtractInterfaceOptionsService TestExtractInterfaceOptionsService ...@@ -67,13 +67,13 @@ public TestExtractInterfaceOptionsService TestExtractInterfaceOptionsService
} }
} }
public ExtractInterfaceTypeAnalysisResult GetTypeAnalysisResult(TypeDiscoveryRule typeDiscoveryRule) public Task<ExtractInterfaceTypeAnalysisResult> GetTypeAnalysisResultAsync(TypeDiscoveryRule typeDiscoveryRule)
{ {
return ExtractInterfaceService.AnalyzeTypeAtPositionAsync( return ExtractInterfaceService.AnalyzeTypeAtPositionAsync(
ExtractFromDocument, ExtractFromDocument,
_testDocument.CursorPosition.Value, _testDocument.CursorPosition.Value,
typeDiscoveryRule, typeDiscoveryRule,
CancellationToken.None).WaitAndGetResult(CancellationToken.None); CancellationToken.None);
} }
public ExtractInterfaceResult ExtractViaCommand() public ExtractInterfaceResult ExtractViaCommand()
......
...@@ -195,11 +195,7 @@ public async Task AssertTag(string expectedFromName, string expectedToName, bool ...@@ -195,11 +195,7 @@ public async Task AssertTag(string expectedFromName, string expectedToName, bool
if (invokeAction) if (invokeAction)
{ {
var operations = actions[0] var operations = (await actions[0].GetOperationsAsync(CancellationToken.None)).ToArray();
.GetOperationsAsync(CancellationToken.None)
.WaitAndGetResult(CancellationToken.None)
.ToArray();
Assert.Equal(1, operations.Length); Assert.Equal(1, operations.Length);
operations[0].Apply(this.Workspace, CancellationToken.None); operations[0].Apply(this.Workspace, CancellationToken.None);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册