Is there an idiomatic way to attach data to a number of different assertions? #1509
Unanswered
anthony-c-martin
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Other than using the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Scenario
Imagine something like the below scenario, where I'd like the additionalInfo to be logged along with any of the assertions if they fail.
Some approaches I already looked at below. I couldn't quite figure out how to make them fit. Sorry if I'm missing something obvious!
Using the AssertionScope
Using a ValueFormatter
Creating my own assertions
I considered whether I could just follow https://fluentassertions.com/extensibility/#building-your-own-extensions and add a bunch of assertions which took in the additional context - e.g.:
Beta Was this translation helpful? Give feedback.
All reactions