I'm a beginner with google mock and I'm not sure how to use it and the concept.
If I'm trying to Test a method from a class that is calling some other methods from different classes. Do I need to mock all these methods from this different classes that my Test method is calling. Here is a example:
class A { public: A () {} int setnum(int num) {//do some stuff return 1 or 0// } private: int _num; }; class B { public: B (){} int init(A *a, int number){ if(a->setnum(number)) return 1; return 0; } void setNum(int num){_num=num;} private: A *_a; int _num; }; class C { public: int doSoemthing(A *a, int number){ if (domore(a,number)) return 1; return 0; } int domore(A *a, int number){ if(_b.init(a,number)) return 1; return 0; ;} private: B _b; }; Do I need to mock all the methods from class A and B that I need to Test my Test method? Or can I just mock one Class , and test if this class is working.