Gmock encourages you to use interface (pure virtual) classes and
dependency injection.
So you will end up with a lot of interface classes that only have one
implementation (if you do not include the mock class). I suppose
nearly all classes need to have an interface (since nearly all classes
may need to be mocked out). Please comment because somehow it is
against my conviction to create interfaces when there is only one
implementation of the interface in the production code...
Instead of making interfaces, wouldn't it be possible to just let the
mock class inherit from the real class? A downside is that you will
have to make all your methods in your real class virtual and that
gives you a performance penalty...
Thank you very much
Paul
Hi
Gmock encourages you to use interface (pure virtual) classes and
dependency injection.
So you will end up with a lot of interface classes that only have one
implementation (if you do not include the mock class). I suppose
nearly all classes need to have an interface (since nearly all classes
may need to be mocked out). Please comment because somehow it is
against my conviction to create interfaces when there is only one
implementation of the interface in the production code...
Instead of making interfaces, wouldn't it be possible to just let the
mock class inherit from the real class?