I want to assign NiceMock with the return value of the method. NiceMock is an instance variable.
class TestFileToOsg : public testing::Test { public: NiceMock<MockFileToOsg>* _mockFileToOsg; protected: virtual void SetUp(); }; void TestFileToOsg::SetUp() { _mockFileToOsg = FixtureFileToOsg::getMockFileToOsgWithValidConfig(); }
Mounting Method:
MockFileToOsg* FixtureFileToOsg::getMockFileToOsgWithValidConfig() { MockFileToOsg* fileToOsg = new MockFileToOsg(...); return fileToOsg; }
The compiler produces the following error:
error: invalid conversion from 'MockFileToOsg*' to 'testing::NiceMock<MockFileToOsg>*'
How can I assign an instance variable to the return value of the binding method?
source share