提交 e917553d 编写于 作者: C Cyrus Najmabadi

Make more tests async.

上级 ce400e97
......@@ -19,20 +19,20 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.GoToDefinition
Public Class GoToDefinitionCancellationTests
<WpfFact, Trait(Traits.Feature, Traits.Features.GoToDefinition)>
Public Sub TestCancellation()
Public Async Function TestCancellation() As Tasks.Task
' Run without cancelling.
Dim updates As Integer = Me.Cancel(Integer.MaxValue, False)
Dim updates As Integer = Await Me.CancelAsync(Integer.MaxValue, False)
Assert.InRange(updates, 0, Integer.MaxValue)
Dim i As Integer = 0
While i < updates
Dim n As Integer = Me.Cancel(i, True)
Dim n As Integer = Await Me.CancelAsync(i, True)
Assert.Equal(n, i + 1)
i = i + 1
End While
End Sub
End Function
<WpfFact, Trait(Traits.Feature, Traits.Features.GoToDefinition)>
Public Sub TestInLinkedFiles()
Public Async Function TestInLinkedFiles() As Tasks.Task
Dim definition =
<Workspace>
<Project Language="C#" CommonReferences="true" AssemblyName="CSProj" PreprocessorSymbols="Proj1">
......@@ -57,7 +57,7 @@ class C
</Project>
</Workspace>
Using workspace = TestWorkspaceFactory.CreateWorkspace(
Using workspace = Await TestWorkspaceFactory.CreateWorkspaceAsync(
definition,
exportProvider:=MinimalTestExportProvider.CreateExportProvider(GoToTestHelpers.Catalog.WithPart(GetType(CSharpGoToDefinitionService))))
......@@ -79,9 +79,9 @@ class C
Assert.True(mockDocumentNavigationService._triedNavigationToSpan)
Assert.Equal(New TextSpan(121, 2), mockDocumentNavigationService._span)
End Using
End Sub
End Function
Private Function Cancel(updatesBeforeCancel As Integer, expectedCancel As Boolean) As Integer
Private Async Function CancelAsync(updatesBeforeCancel As Integer, expectedCancel As Boolean) As Tasks.Task(Of Integer)
Dim definition =
<Workspace>
<Project Language="C#" CommonReferences="true">
......@@ -91,7 +91,7 @@ class C
</Project>
</Workspace>
Using workspace = TestWorkspaceFactory.CreateWorkspace(definition, exportProvider:=GoToTestHelpers.ExportProvider)
Using workspace = Await TestWorkspaceFactory.CreateWorkspaceAsync(definition, exportProvider:=GoToTestHelpers.ExportProvider)
Dim cursorDocument = workspace.Documents.First(Function(d) d.CursorPosition.HasValue)
Dim cursorPosition = cursorDocument.CursorPosition.Value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册