-
Notifications
You must be signed in to change notification settings - Fork 79
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
.ThrowsAsync doesn't appear to work #55
Comments
Hi Tom, thank you for spotting this; unfortunately I have moved to a different role and I am not using this library so it is not under active development. Throw/ThrowAsync is not currently implemented, but I would be more than happy to review a PR if anyone updated the code to support it. |
Hi, thanks for the reply. |
It would be nice if support for this was implemented. Our code has a gap in code coverage because of this. Thanks in advance. |
You can cover you code by throwing synchronously
Hope it will help |
@AliAdravi this is a false positive. When doing this, your code isn't actually throwing the exception. |
anything news? |
Even I am facing similar problem, the SetupDapperAsync code to throw exception doesn't actually throw exception //mock //code I am trying to mock _connection.QueryAsync to throw exception, but it doesn't throw exception |
I am trying to simulate a query throwing an exception. So I can test how my code handles this.
I am doing a setup along the lines of
The code errors whilst performing this setup and throws an exception with the following message:
One or more errors occurred. (error executing db query)
It appears almost as if my dummy exception is being thrown during the setup.
Am I doing something wrong?
Or is .ThrowsAsync not supported?
Thanks for making this library it is very useful
Tom
The text was updated successfully, but these errors were encountered: