I am using gtest/gmock framework to write unit tests. Following is my sample code.
In common.h,
void PreInit() {
cout<<"Doing Pre-initialization."<<endl;
}
In test.cpp,
#include <common.h>
class SampleComponent {
public:
void Init() {
PreInit();
// Do Initialization
}
}
So far, I have been mocking classes. Any idea how to mock independent functions called by member functions of class?
Thanks in advance.