views:

30

answers:

1

I read the question at http://stackoverflow.com/questions/980554/what-is-the-purpose-of-verifiable-in-moq and have this question in my mind. Need your help to explain that.

+1  A: 

VerifyAll is for verify that all the expectationa have been met. Suppose you have:

myMock.Setup(m => m.DoSomething()).Returns(1);
mySut.Do();
myMock.VerifyAll(); // Fail if DoSomething was not called

HTH

ema
This doesnt illustrate the diff between V and VA very well though (which is what the OP asked for), does it?
Ruben Bartelink
You use Verify when you can use the AAA syntax and when you don't need to setup expectation on the mock object.
ema