Skip to content

Conversation

@dennisdoomen
Copy link
Member

@dennisdoomen dennisdoomen commented Jan 14, 2021

  • Formatter.ToString will take an options object that allow you to specify the max depth and the max number of lines to produce
    Both will have defaults
  • AssertionScope will have properties to override this in case you need it
  • Also considering to have the defaults come from AssertionOptions
  • Limit formatting to a maximum number of lines

Fixes #1014

Can be reviewed commit by commit

@dennisdoomen dennisdoomen force-pushed the Fix/1014 branch 3 times, most recently from 735cafa to 7ab46cf Compare March 9, 2021 19:58
@dennisdoomen dennisdoomen force-pushed the Fix/1014 branch 5 times, most recently from 4941255 to d474a26 Compare March 14, 2021 19:25
@dennisdoomen dennisdoomen force-pushed the Fix/1014 branch 2 times, most recently from 523a423 to f9cf9cc Compare March 30, 2021 19:33
@dennisdoomen dennisdoomen force-pushed the Fix/1014 branch 9 times, most recently from 788a6e0 to d8f7aca Compare April 11, 2021 19:31
…LineBreaks option

fixup! Formatter.ToString() now takes a FormattingOptions that wraps the UseLineBreaks option
Those options can be used to tweak the MaxDepth and the UseLineBreaks that the formatter uses to render the object graph in case an assertion fails.
@dennisdoomen dennisdoomen force-pushed the Fix/1014 branch 3 times, most recently from a97c3d3 to 46f2f9b Compare April 17, 2021 14:27
@dennisdoomen dennisdoomen changed the title [WIP] Encapsulates the Formatter options in an object Encapsulates the Formatter options in an object Apr 17, 2021
@dennisdoomen dennisdoomen requested a review from jnyrup April 17, 2021 14:30
@dennisdoomen dennisdoomen changed the title Encapsulates the Formatter options in an object Limit formatting to a maximum number of lines Apr 17, 2021
Copy link
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As requested, here's your additional "shitload of comments"

Copy link
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!
I can't wait to see some failing unit tests

@dennisdoomen dennisdoomen force-pushed the Fix/1014 branch 2 times, most recently from d92d631 to d38f25a Compare April 18, 2021 17:22
@jnyrup
Copy link
Member

jnyrup commented Apr 18, 2021

Just noticed that the docs also needs an update.

https://fluentassertions.com/extensibility/#rendering-objects-with-beauty

@dennisdoomen
Copy link
Member Author

Just noticed that the docs also needs an update.

Damnit. I already did the work to update the extensibility guide and add a section to the tips for migrating to v6. I must have force pushed something away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion crunches for too long on assertion failure on complex graph objects

2 participants