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
Using Should().Throw() with Func<T> fails after upgrading to version 5.5.0 #964
Comments
I will take a look in the evening. |
The problem is that the new overload that takes a |
I haven't looked in the code yet, but what would be your opinion on the idea to change the name of |
No, it's the |
Let me clarify. I understand the fact that it is the Assuming that my reasoning is sound, my question is whether, as a last resort, you would accept using other extension method name than |
Maybe we can keep the |
It seems doable with the following new overload of public static AsyncFunctionAssertions Should<T>(this Func<Task<T>> action)
{
return new AsyncFunctionAssertions(action, extractor);
} |
@jeremyw5 Thanks again for the detailed issue description. |
Description
After upgrading FluentAssertions from version 5.4.2 to 5.5.0, usage of Should().Throw with async method does not yield expected behavior. The following code example functions as expected with version 5.4.2.
Complete minimal example reproducing the issue
Expected behavior:
The assertion for the thrown exception passes.
Actual behavior:
The assertion for the thrown exception does not pass. The assertion does not detect the thrown exception.
Versions
Visual Studio 2017, .NET Core 2.1, XUnit 2.4.1, FluentAssertions 5.5.0
Additional Information
Removal of the 'TResult' argument from the Func<Task> yields expected behavior and the assertion functions as expected with version 5.5.0.
The text was updated successfully, but these errors were encountered: