Why does my partial mock have all virtual methods mocked, even if no expectations are set?
问题 I have a user control which does some validation in the ValidateChildren method which I would like to test. I have created a partial mock of the user control, but although I am not setting any expectations on the ValidateChildren method, I am simply calling it, it is simply skipped and the code inside the method never executes. To try and understand what is going on I created a simple test, like so: public class Foo { public virtual bool Method1() { throw new NotImplementedException(); }