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

Move to new api.

上级 2ebb567e
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
......@@ -60,16 +60,12 @@ public async Task TestFindReferencesAsynchronousCall()
var context = new MockFindUsagesContext();
var presenter = new MockStreamingFindUsagesPresenter(context);
var waiter = new AsynchronousOperationListener();
var waiters =
SpecializedCollections.SingletonEnumerable(
new Lazy<IAsynchronousOperationListener, FeatureMetadata>(
() => waiter, new FeatureMetadata(new Dictionary<string, object>() { { "FeatureName", FeatureAttribute.FindReferences } })));
var listenerProvider = new AsynchronousOperationListenerProvider();
var handler = new FindReferencesCommandHandler(
TestWaitIndicator.Default,
SpecializedCollections.SingletonEnumerable(new Lazy<IStreamingFindUsagesPresenter>(() => presenter)),
waiters);
listenerProvider);
var textView = workspace.Documents[0].GetTextView();
textView.Caret.MoveTo(new SnapshotPoint(textView.TextSnapshot, 7));
......@@ -77,6 +73,7 @@ public async Task TestFindReferencesAsynchronousCall()
textView,
textView.TextBuffer), () => { });
var waiter = listenerProvider.GetWaiter(FeatureAttribute.FindReferences);
await waiter.CreateWaitTask();
AssertResult(context.Result, "C.C()", "class C");
}
......@@ -90,4 +87,4 @@ public async Task TestFindReferencesAsynchronousCall()
definitions.OrderBy(a => a));
}
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册