提交 2ce1ac42 编写于 作者: Y Youssef Victor

Fix tests

上级 9b3f5b50
......@@ -2551,7 +2551,7 @@ interface ISomeInterface
[WorkItem(48064, "https://github.com/dotnet/roslyn/issues/48064")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)]
public async Task TestInvocationWithinAsynchronousForEach()
public async Task TestInvocationWithinAsynchronousForEach_IAsyncEnumerableDoesNotExist_FallbackToIEnumerable()
{
await TestInRegularAndScriptAsync(
@"class C
......@@ -2581,10 +2581,46 @@ await foreach (var item in _someInterface.GetItems())
interface ISomeInterface
{
IAsyncEnumerable<object> GetItems();
IEnumerable<object> GetItems();
}");
}
[WorkItem(48064, "https://github.com/dotnet/roslyn/issues/48064")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)]
public async Task TestInvocationWithinAsynchronousForEach_IAsyncEnumerableExists_UseIAsyncEnumerable()
{
await TestInRegularAndScriptAsync(
@"class C
{
async void M(ISomeInterface _someInterface)
{
await foreach (var item in _someInterface.[|GetItems|]())
{
}
}
}
interface ISomeInterface
{
}
" + IAsyncEnumerable,
@"class C
{
async void M(ISomeInterface _someInterface)
{
await foreach (var item in _someInterface.GetItems())
{
}
}
}
interface ISomeInterface
{
System.Collections.Generic.IAsyncEnumerable<object> GetItems();
}
" + IAsyncEnumerable);
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)]
public async Task TestInvocationOffOfAnotherMethodCall()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册