How to mock an object that extends a class and implements an interface?

What your design is really saying is that your class MyClass does not have a dependency on IFoo it has a dependency on a class instance derived from BaseFoo and implementing IFoo . In this case it is probably best that you introduce a unifying interface which you can then use as a dependency and mock.

How about declaring an abstract class (BaseFooFoo?) that derives from BaseFoo and implements IFoo. Then you could show BaseFooFoo to moq.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions