Author : MD TAREQ HASSAN
ITestOutputHelper
- Used to write test Diagnostic Message
- This will write to test output, not in console output
- DI: xUnit will insert it in the test class constructor
CalculatorTest.cs
Public class CalculatorTest {
private readonly ITestOutputHelper _testOutput;
public CalculatorTest(ITestOutputHelper _testOutput)
{
this._testOutput = _testOutput;
}
[Fact]
public void MyTest(){
// test goes here
// ... ... ...
_testOutput.WriteLine("This will write to test output, not in console output");
}
}