unit-testingxunit.net

Current test status in xUnit.net


How can I get status of currently executed test? I'd like to know in Dispose() method if current test failed or not. This should be something similar to mstest's TestContext.CurrentTestOutcome.


Solution

  • I've asked the same question on xunit site and I can share the answer here too. Basicaly according to https://github.com/xunit/xunit/issues/398 there is no way to know test status inside the test. Also according to https://github.com/xunit/xunit/issues/416 there is no such thing as TestContext in xunit.