Normally, I mock my repo like so:
var repository = new Mock(); repository.Setup(r => r.GetMemberAsync(email)) .Returns(Task.FromResult
You get a compiler error because you return a task that doesn't match the type the async method returns. You should return Task instead of simply Task:
Task
repository.Setup(r => r.GetMemberAsync(email)).Returns(Task.FromResult(null));