You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: