It is not possible. Because of the way Moq works, there is no chance Moq can mock a non-virtual method.
Are you mocking the class type YourClass
directly, where YourClass
derives from BaseClass
, and BaseClass
has this (public
?) non-virtual non-static method that interests you? So your mock has type Mock<YourClass>
, not Mock<IYourClass>
where IYourClass
is an interface?
Is it strictly necessary that you use BaseClass
as a base class, rather than "composing" (having a field of type BaseClass
insider your class)?