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

Confusing failure message in Should().BeAssignableTo(...) #1103

Tyrrrz opened this issue Jul 27, 2019 · 2 comments


Copy link

commented Jul 27, 2019


When Should().BeAssignableTo(...) fails, it leaves a confusing message.

Complete minimal example reproducing the issue

((object) null).Should().BeAssignableTo(typeof(string));

Expected behavior:

Expected an object assignable to System.String, but found <null> instead.

Actual behavior:

Expected type not to be System.String, but found <null>.


  • Which version of Fluent Assertions are you using?


  • Which .NET runtime and version are you targeting? E.g. .NET framework 4.6.1 or .NET Core 2.0.

.NET 4.6

Additional Information



This comment has been minimized.

Copy link

commented Jul 27, 2019

Thank you ❤️


This comment has been minimized.

Copy link

commented Aug 10, 2019

Just a heads up: 5.8.0 has been released with the fix for this.

And thanks for reporting this, it's appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.