【发布时间】:2017-08-07 12:38:15
【问题描述】:
假设我有一个基类:
class Command {
public:
virtual int8_t Execute();
};
在基类 cpp 中有定义。
另外,我有一个子类:
class SpecificCommand: public Command {
public:
int8_t Execute();
};
有定义:
int8_t SpecificCommand::Execute() {
doSomeStuff();
Command::Execute();
}
如何模拟 Command::Execute() 但使用 SpecificCommand 对象进行测试?
【问题讨论】:
标签: c++ unit-testing testing mocking googlemock