I am trying to set up a mock for the ExecuteAsync method on the IDBConnection and getting a method not supported exception.
Here is an example,
public ApplicationRepositoryTests()
{
var connection = new Mock<IDbConnection>();
connection.SetupDapperAsync(dapper => dapper.ExecuteAsync(It.IsAny<string>(), It.IsAny<object>(), It.IsAny<IDbTransaction>(), It.IsAny<int?>(), It.IsAny<CommandType?>())).Returns(Task.FromResult(0));
var repository = new ApplicationRepository(Mock.Of<IConfiguration>(), Mock.Of<IHostEnvironment>(), connection.Object);
}
Exception:
System.NotSupportedException: Specified method is not supported.
Any suggestions or workaround to set this up properly, please?
I am trying to set up a mock for the ExecuteAsync method on the IDBConnection and getting a method not supported exception.
Here is an example,
Exception:
System.NotSupportedException: Specified method is not supported.
Any suggestions or workaround to set this up properly, please?