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

Add a new warning when using .Throws() when mocking a method returning a Task #164

Closed
Socolin opened this issue Aug 27, 2021 · 0 comments · Fixed by #178
Closed

Add a new warning when using .Throws() when mocking a method returning a Task #164

Socolin opened this issue Aug 27, 2021 · 0 comments · Fixed by #178
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Socolin
Copy link

Socolin commented Aug 27, 2021

Hello,

I think it would be nice to have a warning when using .Throws() on a method returning a Task instead of .Returns(Task.FromException) (or maybe ThrowsAsync when available Related to: nsubstitute/NSubstitute#609)

This would help to mock exception correctly on async methods.

@tpodolak tpodolak added the enhancement New feature or request label Aug 27, 2021
tpodolak added a commit that referenced this issue Jan 5, 2022
tpodolak added a commit that referenced this issue Jan 5, 2022
tpodolak added a commit that referenced this issue Jan 5, 2022
tpodolak added a commit that referenced this issue Jan 5, 2022
tpodolak added a commit that referenced this issue Jan 5, 2022
@tpodolak tpodolak self-assigned this Jan 8, 2022
tpodolak added a commit that referenced this issue Jan 16, 2022
tpodolak added a commit that referenced this issue Jan 16, 2022
@tpodolak tpodolak added this to the 1.0.16 milestone Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants