NiceMock<T>
inherits from T
, so the only thing that needs to know it's a NiceMock is the thing that creates it. From that point onwards, you can deal with it as T
.
For example, it's perfectly ok to do this:
ExposedMockClass* mockObject = new testing::NiceMock<ExposedMockClass>();
EXPECT_CALL(*mockObject, exampleFunction(_,_));