xUnit v3 log arguments of failed test #3348
-
I'd like to log (or maybe even add as attachment) the arguments that were used in a test if that test fails. I'm using It might be that my approach is not the right way to go about this, in that case maybe you have better suggestions? After this I'd like to add this attribute to all tests automatically but I haven't looked into that yet. Any help would be greatly appreciated. John |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
TestContext.Current.TestState
which returnsTestResultState
. It has aResult
property, which returnsTestResult
, in addition to containing more information depending on the result (for example, you can get exception information for failed tests).