我正在使用withNUnit
和AutoFixture
属性。AutoMoq
Theory
这是我的测试方法,
[TestFixture]
public class TestClass
{
[Theory, AutoMoqData]
public void TestI(I i)
{ }
}
界面
public interface I
{ }
和属性
public class AutoMoqDataAttribute : AutoDataAttribute
{
public AutoMoqDataAttribute()
: base(new Fixture().Customize(new AutoMoqCustomization()))
{ }
}
当我构建我的解决方案时,会发现测试。当我运行测试时,以下内容将写入输出窗口:
NUnit 1.0.0.0 executing tests is started
Run started: [...].Test.dll
NUnit 1.0.0.0 executing tests is finished
Test adapter sent back a result for an unknown test case. Ignoring result for 'TestI(Mock<TestClass+I:1393>.Object)'.
使用xUnit.net
上述测试时运行正常。为什么不使用它NUnit
?
我在测试项目中安装了以下 Nuget 包:
- 自动夹具 3.18.1
- AutoFixture.AutoMoq 3.18.1
- 起订量 4.2.1402.2112
- NUnit 2.6.3
- NUnitTestAdapter 1.0
我在 Visual Studio 2013 Professional 中运行测试。我还尝试在单独的 GUI 运行器中运行测试,结果相同。