Mock a method of the subject under test in Moq?
It is, with a catch! You have to make sure method B is virtual and can be overriden. Then, set the mock to call the base methods whenever a setup is not provided. Then you setup B, but don’t setup A. Because A was not setup, the actual implementation will be called. var myClassMock = … Read more