The differences are explained in this article.
If you do not create any expectations in StrictMock and the method is called in mock, an exception will be thrown.
If you do not create any expectations in PartialMock , and the method is called in the layout, nothing special happens. If this layout comes from a base class, the call expires before the existing base implementation.
There is also something called DynamicMock . If you do not create expectations in DynamicMock , and the method is called in the layout, the stub method is called. If there was a return value, the default value is returned (for example, null or 0 ).
GenerateMock I believe that creates DynamicMock .
Ayende chose this default because he recommends the ideal using only DynamicMock and Stub . StrictMock creates fragile tests and usually violates the concept of only testing one behavior per test.
See this article: http://ayende.com/wiki/Rhino%20Mocks%203.5.ashx#CreateMockisdeprecated,replacedbyStrictMockTheuseofStrictMockisdiscouraged
I also saw how he said that it is useful to start with severe bullying, and work with your tests back to dynamic layouts / stubs, when you are comfortable with how your test code behaves. There is no link for this:
Merlyn morgan-graham
source share