SpecFlow supports xUnit 2.4 or later.

Documentation for xUnit can be found here.

Needed NuGet Packages

For SpecFlow: SpecFlow.xUnit

For xUnit: xUnit

For Test Discovery & Execution:

Access ITestOutputHelper

The xUnit ITestOutputHelper is registered in the ScenarioContainer. You can get access to simply via getting it via Context-Injection.


using System;
using TechTalk.SpecFlow;

public class BindingClass
    private Xunit.Abstractions.ITestOutputHelper _testOutputHelper;
    public BindingClass(Xunit.Abstractions.ITestOutputHelper testOutputHelper)
        _testOutputHelper = testOutputHelper;

    [When(@"I do something")]
    public void WhenIDoSomething()