Unit Testing Mock/Stub definitions in Moq

Viewed 5683

Any reading or advice I've been given on Unit Testing has always suggested a distinct difference between the definition of a Mock and a Stub. My current understanding of these definitions are as follows

Mock: A fake which will be used in your test to make a final assertion

Stub: A fake which will be used in your test to isolate a dependency but not be asserted

However, Moq appears to only allow the creation of Mocks. The Stub namespace in the framework appears to be depreciated with recommendations to use Mock.SetupXXX.

Am I missing something in my understanding of this? Or is there a general understanding that a mock object can infact be used as nothing more that a stub?

Perhaps I am being pedantic, it's just that I have always found language in programming to be very strict and prefer to get my usage of it correct, especially when other developers might be taking over a project.

4 Answers
Related