views:

20

answers:

1

The short document of Moq doesn't help me to understand this. Help!

A: 

You may find this post from Hadi Hariri helpful !

With strict mocks EVERY single call to the mocked object has to have expectations set on it. If we make an additional call and we don't set the expectation, our test will fail

For me, "strict"/default mode will throw exception if there's a call to non-set-up methods, i.e. mockObject.MethodWithoutSetup. Whilst, "loose" mode will allow that.

Nam Gi VU