Skip to content

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

@Tyrrrz

Description

@Tyrrrz

Description

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>.

Versions

  • Which version of Fluent Assertions are you using?

5.7.0

  • 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

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions