'Mock class instantiated in constructor of other class in Gtest
class B;
class A
{
public:
A() { b = std::make_shared<B>(this); }
void method() { b->methodB(); }
private:
std::shared_ptr<B> b;
};
class B
{
public:
...
void methodB() {}
};
I want to test if methodB is called from method. How to mock class B in order to make this possible?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
