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

ISetupSequentialResult doesn't support Pass for async void methods. #993

Closed
fuzzybair opened this issue Apr 7, 2020 · 3 comments
Closed
Assignees
Milestone

Comments

@fuzzybair
Copy link
Contributor

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)

@stakx
Copy link
Contributor

stakx commented Apr 18, 2020

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.

@fuzzybair
Copy link
Contributor Author

No problem for the delay we all have busy lives 😃 I have added the pull request #1006

@stakx
Copy link
Contributor

stakx commented Apr 27, 2020

Closed by #1006.

@stakx stakx closed this as completed Apr 27, 2020
@stakx stakx modified the milestones: 4.15.0, 4.14.1 Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants