I am a bit confused in the usage of the keywords fake and mock depending on the various Mock/TDD frameworks.
I do understand the meaning of a mock and of a fake and per my understanding I am using this syntax right now:
// I prepare my fakes with custom expected behaviours
IUnitOfWork fakeUnitOfWork = new Mock<IUnitOfWork>();
IRepository fakeRepository = new Mock<IRepository>();
// I initialize the mock under test
MyCommandHandler mockHandler =
new MyCommandHandler(fakeUnitOfWork.Object, fakeRepository.Object);
// I act on my Mock
mockHandler.Handle(new Command("whatever"));
// I assert
fakeUnitOfWork.Verify(x => x.Commit(), Times.Once());
fakeRepository.Verifx(x => x.Add("whatever"), Times.Once());
Is this the correct usage of the prefix mock and fake or should I use mock for IUnitOfWork
and for IRepository
and MyCommandHandler
is just a normal object under test?