Skip to content
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

Support for ThrowsAsync on async methods only returning Task #194

Closed
jblacker opened this issue Aug 4, 2015 · 1 comment
Closed

Support for ThrowsAsync on async methods only returning Task #194

jblacker opened this issue Aug 4, 2015 · 1 comment

Comments

@jblacker
Copy link

jblacker commented Aug 4, 2015

The new async support via the added extension methods works great when a method returns Task<T>. However, there isn't really support for methods that return Task. I know that there are some other open issues regarding problems with methods returning task, but this is an enhancement request for the ThrowsAsync() method to be available even if the Task itself is not returning anything.

The use case that I in particular have for this is for the handling of bad arguments. The implemented versions of these methods throws an ArgumentException, which I want to simulate in my testing.

My current workaround is to use a TaskCompletionSource and set the exception using its SetException method. However, this isn't as convenient a when a Task<T> is returned and ThrowsAsync() can be used instead.

@stakx
Copy link
Contributor

stakx commented Jun 18, 2017

This has been taken care of by #357.

@stakx stakx closed this as completed Jun 18, 2017
@devlooped devlooped locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants