我想测试一些失败的情况下,不会在模拟对象上调用任何方法,使用谷歌模拟。所以代码是这样的:
auto mocObj = new MockObj;
EXPECT_NO_METHOD_CALL(mocObj); //this is what I'm locking for
auto mainObj = new MainObj(mocObj , ......and other mocks); // here I simulate a fail using the other mock objects, and I want to be sure the no methods are called on the mockObj