How to capture output with XUnit 2.0 and FSharp style tests
问题 Normally I write my unit tests in F# as open Swensen.Unquote open Xunit module MyTests = [<Fact>] let ``SomeFunction should return 10`` () = let a = SomeFunction() test <@ a = 10 @> [<Fact>] let ``SomeOtherFunction should return 11`` () = let a = SomeFunction() test <@ a = 11 @> If I wish to log to the console from xunit ( according to http://xunit.github.io/docs/capturing-output.html ) one needs to write a constructor that takes an ITestOutputHelper and then use that instead of Console