Given the following interface:
public interface IApiHelper
{
dynamic CallApi(string url);
}
I sent an instance of a Mock<IApiHelper> _apiHelperMock
I am trying to write a test that returns the Success = true property to simulate a JSON result. My setup looks like this:
_apiHelperMock.Setup(o => o.CallApi(It.IsAny<string>())).Returns((dynamic)new { Success = true });
However, when I try to run the test, I get the following error: Moq.Language.Flow.ISetup 'does not contain a definition for' Returns'
Can someone tell me what I'm doing wrong here?
source
share