'XUnit and ITestOutputHelper instantiation
I'm trying to use ITestOutputHelper to use Serilog. While I see that I can inject this as a parameter, I have a base class that handles all the configuration and many tests now that derived from this base class.
I don't want to have to add a constructor to each base class to inject this value, is there a way to manually instantiate this?
I did try var output = new TestOutputHelper(); but it does not seem to work.
Thank you,
Solution 1:[1]
No, you have to pass it in constructor of your test class, so framework knows which logs belong to which test.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shadow |
