-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IAsyncEnumerable ReturnsAsync support #1250
Conversation
This adds ReturnsAsync overloads that support IAsyncEnumerable types.
Also adding tests.
Not sure what is best here -- none of the methods that await an IAsyncEnumerable will evaluate it to a null collection.
Hi @cdonnellytx and thanks for contributing. Your PR is touching a few things that I was hoping to leave behind in the past, so I am not convinced this should get merged:
Your PR's main goal (glossing over the time delay overloads) appears to be saving users from having to call |
Yes, that is correct. I am hoping to avoid having to do that, especially since - service.Setup(m => m.GetRelatedIdsAsync(1)).ReturnsAsync(new[] { 1, 2, 3 });
+ service.Setup(m => m.GetRelatedIdsAsync(1).ToEnumerable()).Returns(new[] { 1, 2, 3 }); |
Finally found time to take a closer look at this. Sorry to say but I'm going to close this without merging.
|
This adds
ReturnsAsync
overloads that can returnIAsyncEnumerable<T>
based on an inputIEnumerable<T>
value.This was first requested in #962.
Additional information