I have recently switched a project from NUnit to xUnit so that ITestOutputHelper can be used to output to a log.
The project is a fairly standard layout
Feature Files->Step Classes->Page Classes->Help Classes. Include in the helper classes we have the hooks.class also. I am using the xUnit runner.
So in my hooks class I have created this
private readonly ScenarioContext _scenarioContext;
private ITestOutputHelper _testOutputHelper;
public Hooks(ScenarioContext scenarioContext, ITestOutputHelper testOutputHelper)
{
_scenarioContext = scenarioContext;
this._testOutputHelper = testOutputHelper;
}
public void WriteOutput(string theMessage)
{
_testOutputHelper.WriteLine(theMessage);
}
Now my question is how do I access the WriteOutput function from the other classes? Or have I placed it in the wrong class?