I'm writing unit tests with CppUTest & CppUMock framework.
Here is a example of what I have :
class ClassA
{
public:
ClassA(ClassB &classB);
}
class ClassB
{
public:
ClassB();
void DoingThings(void);
}
I want to unit test ClassA. The thing is that ClassA is using a reference to ClassB, that's why I'd like to mock ClassB.
My problem is that ClassB doesn't contain any virtual classes. So inheritance which saved my life until now is not working this time. Indeed until now I only had ClassB inheriting from interfaces which was pretty convenient because I could write ClassBMock inheriting from the same interface.
My question is how to mock ClassB (using CppUTest/CppUMock framework) ?