I would like to know if with HippoMock it is possible to mock just a parts of a class.
Example
class aClass
{
public:
virtual void method1() = 0;
void method2(){
do
doSomething; // not a functon
method1();
while(condition);
};
};
I would like to mock just method1 in order to test the method 2
Clearly I use HippoMock and I have a bug in method2 so I made a unit test in order to correct it and be sure it will not come back. But i don't find the way to do it.
I try this
TEST(testMethod2)
{
MockRepository mock;
aClass *obj = mock.Mock<aClass>();
mock.ExpectCall(obj , CPXDetector::method1);
obj->method2();
}
Is there some solution in native cpp ? With an other mock framework ?
Thanks a lot
Ambroise Petitgenêt