I am struggling to be able to log to output during FsCheck.Xunit unit tests in C#. I am using ITestOutputHelper as I believe this is the recommended approach with Xunit.
In the example tests below, Test1 will not pipe "Hi" to the output but Test2 will (on latest .NET Core using Visual Studio on Windows).
Any help appreciated.
BR, Mark
public class NewTests
{
private readonly ITestOutputHelper _output;
public NewTests(ITestOutputHelper output)
{
_output = output;
}
[Property(Verbose = true)]
public Property Test1()
{
_output.WriteLine("Hi");
return true.ToProperty();
}
[Fact]
public void Test2()
{
_output.WriteLine("Hi");
Assert.Equal(1,1);
}
}