How to get SpecFlow working with xUnit.net as the test runner

specflow, xunit.net

Solution

There is an example for SpecFlow with xUnit in the SpecFlow-Example repository:

http://github.com/techtalk/SpecFlow-Examples/tree/master/BowlingKata/BowlingKata-XUnit

In order to run it, you have to build SpecFlow from the latest sources on github (master branch). You also should have installed SpecFlow 1.2 in order to get proper VisualStudio integration. Then replace all the assemblies in you installation directory (default Program Files (x86)\TechTalk\SpecFlow) with the assemblies built from source.

After this you should be able to build and run the above SpecFlow-Example project.

Hope this helps?

Problem

I'm trying to use xUnit.net as the test runner for SpecFlow. The SpecFlow 1.2 binaries from the official download area don't contain an xUnit.net provider but the master branch on GitHub has one, so I build SpecFlow.Core.dll from that. I'm using xUnit.net 1.5. However, when I change the unitTestProvider name in the app.config in my spec project, I get a null reference custom tool error and the generated .feature.cs file is the single line: ``` Object reference not set to an instance of an object. ``` Has anyone succeeded in getting SpecFlow to work with xUnit.net? If so, how?

Original source