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
ISetupSequentialAction provides Pass() and Throws<TException>() for synchronous method calls with void return types. But because async void methods return a Task SetupSequence() uses ISetupSequentialResult<Task>. Pull Request #261 added support for ReturnsAsync and ThrowsAsync if there is a return type async Task<TResult> DoAsync() but it does not support Pass and ThowsAsync for void returns like async Task DoAsync().
If you are interested I could set up a pull request to add public static ISetupSequentialResult<Task> PassAsync(this ISetupSequentialResult<Task> setup)
and public static ISetupSequentialResult<Task> ThrowsAsync(this ISetupSequentialResult<Task> setup, Exception exception)
The text was updated successfully, but these errors were encountered:
Hi @fuzzybair, sorry for the delayed response. Sounds like a reasonable enhancement, feel free to submit a PR, if you'd like. Note that there should probably also be two additional overloads covering ValueTask.
ISetupSequentialAction
providesPass()
andThrows<TException>()
for synchronous method calls with void return types. But because async void methods return a TaskSetupSequence()
usesISetupSequentialResult<Task>
. Pull Request #261 added support for ReturnsAsync and ThrowsAsync if there is a return typeasync Task<TResult> DoAsync()
but it does not support Pass and ThowsAsync for void returns likeasync Task DoAsync()
.If you are interested I could set up a pull request to add
public static ISetupSequentialResult<Task> PassAsync(this ISetupSequentialResult<Task> setup)
and
public static ISetupSequentialResult<Task> ThrowsAsync(this ISetupSequentialResult<Task> setup, Exception exception)
The text was updated successfully, but these errors were encountered: