Skip to content

Allow custom formatters to "kick in" for more specific types #309

@pveller

Description

@pveller

Custom formatters (I am referring to Formatters section in https://github.com/dennisdoomen/fluentassertions/wiki#extensibility) are right now selected by exact match of types:

https://github.com/dennisdoomen/fluentassertions/blob/develop/Src/Core/Formatting/AttributeBasedFormatter.cs#L63

Given #308 I wonder if it would be better to go by isAssignableFrom() instead? It would then be possible to implement a catch all custom formatter with object as an argument and completely disable the default formatter that builds the object's graph.

Or maybe introduce an interface that formatters would need to implement to give them (the formatters) the ability to respond to CanHandle() ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions