While I was searching / reading this answer, I thought that I would also ask here.
I have a class that is a wrapper for the SDK. The class takes an ILoader and uses an ILoader to create an ISBAObject, which is passed to the ISmallBusinessInstance. I'm just trying to make fun of this behavior with Moq.
[TestMethod]
public void Test_Customer_GetByID()
{
var mock = new Mock<ILoader>();
var sbainst = new Mock<ISbaObjects>();
mock.Expect(x => x.GetSbaObjects("")).Returns(sbainst);
}
Compiler Error: Error 1 The best overloaded method matching for "Moq.Language.IReturns.Returns (Microsoft.BusinessSolutions.SmallBusinessAccounting.Loader.ISbaObjects)" contains some invalid arguments
What's going on here? I expected that the Mock from ISbaObjects could be returned without problems.
source
share