How do I verify that method was NOT called in Moq?
Does it have something like AssertWasNotCalled?
UPDATE: Starting from Version 3.0, a new syntax can be us
This does not work in recent versions of Moq (since at least 3.1), it should be specified in the
Verifymethod as mentioned in the answer.
Actually, it's better to specify .AtMost(0) after the Returns statement.
var m = new Mock();
m.Expect(x => x.Forbidden()).Returns("foo").AtMost(0);
Although the "throws" also works, AtMost(0) is more expressive IMHO.