.net Autofixture AutoData错误-未提供任何参数

.net Autofixture AutoData错误-未提供任何参数,.net,nunit,moq,autofixture,.net,Nunit,Moq,Autofixture,我试图通过以下方式使用AutoFixture中的AutoData功能进行NUnit测试: [Test] [AutoData] public void PharmaciesAndDelegatesShouldBeLinkedEachOther(string s) { ... } 但是,我在运行测试时收到以下错误。只要我不通过该参数,测试中的其他所有内容都正常工作: 结果消息:未提供任何参数 我做错了什么?确保您在测试项目中安装了NUnit(2.6.3)NuGet包的最新版本。如果您使用的

我试图通过以下方式使用AutoFixture中的AutoData功能进行NUnit测试:

[Test]
[AutoData]
public void PharmaciesAndDelegatesShouldBeLinkedEachOther(string s) {
    ...
}
但是,我在运行测试时收到以下错误。只要我不通过该参数,测试中的其他所有内容都正常工作:

结果消息:未提供任何参数


我做错了什么?

确保您在测试项目中安装了NUnit(2.6.3)NuGet包的最新版本。如果您使用的是本机NUnit runner(控制台或GUI),还应确保您使用的是最新版本(2.6.3)

然后,如果您的测试项目中安装了AutoFixture.Nunit2软件包,并且您使用的是最新的NUnit 2.6.3和Resharper版本至少为8.1,则需要手动将绑定重定向添加到测试项目的app.config文件(正如在AutoFixture.Nunit2软件包安装后打开的readme.txt文件中所述):


就这些。我正在使用VS2013、NUnit 2.6.3、AutoFixture.Nunit2 3.21.1、Resharper测试运行程序和本机NUnit运行程序(控制台和GUI),它工作得非常好。

奇怪的是,NUnitestAdapter包似乎与AutoFixture AutoData属性不兼容。。。我安装了TestDriven.Net并用它运行了测试,AutoData工作得很好,将参数毫无问题地提供给方法


谢谢你的回答

在通过NuGet安装和使用AutoFixture.NUnit2后,您是否遇到此行为?是的,我通过NuGet安装了AutoFixture.NUnit2,版本3.21.1如何运行上述测试?(例如,使用外接程序、ReSharper等)我正在使用Visual Studio 2013测试运行程序和NUnit测试适配器包。我将尝试一下TestDriven.Net,看看它是否能正常工作。
<dependentAssembly>
    <assemblyIdentity name="nunit.core.interfaces" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.6.3.13283" newVersion="2.6.3.13283" />
</dependentAssembly>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
          <assemblyIdentity name="nunit.core.interfaces" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-2.6.3.13283" newVersion="2.6.3.13283" />
      </dependentAssembly> 
    </assemblyBinding>
  </runtime>
</configuration>
using NUnit.Core.Extensibility;

namespace Test.Project
{
    [NUnitAddin]
    public class LocalAddin : Ploeh.AutoFixture.NUnit2.Addins.Addin
    {   
    }
}