Automapper IMapper stops Fill with Mocks
andychin7777 opened this issue · 5 comments
Sorry if this is a noob issue,
With the new automapper IMapper needs to be injected into the constructors
MoqComplete is not able to show fill with mocks,
Removing the IMapper allows it to work though.
Is there a way for moqComplete to work correctly with third party library interfaces? Or will it not be able to see them?
I'm going to investigate this.
Can you please share the signature of IMapper, IUserDal, and also your test class? I wonder where/how all these are defined and declared (in particular, are they nested?)
I've created simple test and dummy interface to show it better than trying to dump my work code in, the problem still occurs, but works fine if IMapper is commented out. (Note: I needed to restart Visual studio to get the project scanned again for resharper plugin to work.)
[TestFixture]
public class UnitTest1
{
[Test]
public void TestMethod1()
{
var moq = new Mock<TestClass>();
var testClass = new TestClass();
}
}
public class TestClass
{
private IMapper _thisMapper;
private IDummyInterface _dummy;
public TestClass(IMapper thisMapper,
IDummyInterface dummy)
{
_thisMapper = thisMapper;
_dummy = dummy;
}
}
public interface IDummyInterface
{
void DummyFunction(bool isDummy);
}
I have reproduced your issue (with IMapper coming from external library).
Thanks for pointing this out!
I'm going to fix it
The issue should be fixed with version 1.4.4; should be available soon.
Thanks!
Closing as the last version should be available. Please reopen if the bug remains