public interface IFoo
{
Task<bool> DoSomethingAsync();
}
var mock = new Mock<IFoo>();
// Preferred way 4.16+
mock.Setup(foo => foo.DoSomethingAsync().Result).Returns(true);
// Preferred way earlier than 4.16
mock.Setup(foo => foo.DoSomethingAsync()).ReturnsAsync(true);
From Moq Quickstart - Async Methods