nunit-vs-adapter
nunit-vs-adapter copied to clipboard
NUnit ignores test when requesting mock from AutoFixture/AutoMoq
I'm using NUnit with AutoFixture, AutoMoq and the Theory attribute.
Here is my test method,
[TestFixture]
public class TestClass
{
[Theory, AutoMoqData]
public void TestI(I i)
{ }
}
the interface
public interface I
{ }
and the attribute
public class AutoMoqDataAttribute : AutoDataAttribute
{
public AutoMoqDataAttribute()
: base(new Fixture().Customize(new AutoMoqCustomization()))
{ }
}
When I build my solution the test is discovered. When I run the test the following is written to the Output window:
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)'.
Why is not it working with NUnit? (It works fine with both xUnit.net and TestDriven.Net.)
I have the following Nuget packages installed in the test project:
- AutoFixture 3.18.1
- AutoFixture.AutoMoq 3.18.1
- Moq 4.2.1402.2112
- NUnit 2.6.3
- NUnitTestAdapter 1.0
I'm running the test from within Visual Studio 2013 Professional. I also tried running the test in the separate GUI runner, with the same result.
This is basically the last example from here, except it's not working. http://madstt.dk/nunit-support-for-autofixture
I imagine this will be equally an issue in V3 if confirmed.