In my test, I defined as data a List
with some record in.
I\'d like setup a moq the methode Update
, this method receive the user <
If you just want to verify this method is called, you should use Verifiable() method.
_mockUserRepository.Setup(mr => mr.Update(It.IsAny(), It.IsAny()))
.Verifiable();
If you also want to do something with those parameters, use Callback() first.
_mockUserRepository.Setup(mr => mr.Update(It.IsAny(), It.IsAny()))
.Callback((int id, string lastName) => {
//do something
}).Verifiable();
Update
Here's how you should mock it if you return a bool value as result.
_mockUserRepository.Setup(mr => mr.Update(It.IsAny(), It.IsAny()))
.Returns(true);