I am faking a service using FakeItEasy
string phone = "123456";
var response = new VerifyResponse();
var fakeVerifyService = A.Fake<IVerifyService>();
var verifyCall = A.CallTo(() => fakeVerifyService.Verify(
A<string>._,
An<VerifyRequest>._));
//act
verifyCall.Returns(Task.FromResult(response ));
var result = await this.TestSubject.Handle(new VerifyPhoneCommand(phone), CancellationToken.None);
verifyCall.MustHaveHappened();
The problem here is that the implementation of IVerifyService.Verify
is being called in the SUT method.
What am I doing wrong?