未验证 提交 ef70ab5f 编写于 作者: Y Youssef Victor 提交者: GitHub

Add test for IAsyncEnumerable<string>

上级 2ce1ac42
......@@ -2621,6 +2621,42 @@ interface ISomeInterface
" + IAsyncEnumerable);
}
[WorkItem(48064, "https://github.com/dotnet/roslyn/issues/48064")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)]
public async Task TestInvocationWithinAsynchronousForEach_IAsyncEnumerableExists_UseIAsyncEnumerableOfString()
{
await TestInRegularAndScriptAsync(
@"class C
{
async void M(ISomeInterface _someInterface)
{
await foreach (string item in _someInterface.[|GetItems|]())
{
}
}
}
interface ISomeInterface
{
}
" + IAsyncEnumerable,
@"class C
{
async void M(ISomeInterface _someInterface)
{
await foreach (string item in _someInterface.GetItems())
{
}
}
}
interface ISomeInterface
{
System.Collections.Generic.IAsyncEnumerable<string> 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.
先完成此消息的编辑!
想要评论请 注册