AutoDext AutoData attribute throws System.InvalidOperationException using Xunit

I use xunit v2.1.0, xunit.extensions v1.8.0.1549, AutoFixture v3.40.0, AutoFixture.Xunit v3.40.0, and I have this simple trivial test that uses AutoData p>

using Ploeh.AutoFixture.Xunit; using Xunit; namespace Tests { public class ToolTests { [Theory, AutoData] public void Test(int foo) { Assert.NotEqual(0, foo); } } } 

And the error I get in Resharper test runner (v9.2),

System.InvalidOperationException No data found for Tests.ToolTests.Test Exception has no stacktrace

I noticed that xunit.extensions is not the latest version (currently v2.0.0), but when I try to update this nuget package, I get an error:

Unable to resolve dependencies. "xunit.extensions 2.0.0" is incompatible with the "AutoFixture.Xunit 3.40.0 restriction: xunit.extensions (β‰₯ 1,8.0.1549 & <2.0.0) '

Any clues why this is happening?

+6
source share
1 answer

You need to use the AutoFixture.Xunit2 package instead of AutoFixture.Xunit when you use xUnit 2.0 or higher.

+10
source

All Articles