class imUtils
{
public :
virtual std::vector<std::int32_t> getSectorIds(std::int32_t);
};
class ResMap : public GTS::IMUTILS::imUtils
{
public:
ResMap(){}
std::vector<std::int32_t> getSectIdsFromBcfId(std::int32_t);
};
std::vector<std::int32_t> ResMap::getSectIdsFromBcfId(std::int32_t bcfId)
{
std::vector<std::int32_t> sectList;
std::cout << "*******Nagaraj Calling getSectorIds******" << std::endl;
sectList = GTS::IMUTILS::imUtils::getSectorIds(bcfId);
return sectList;
}
hi all,
i am new to gmock, i have facing this issue. Please do the needful
class MockimUtils : public GTS::IMUTILS::imUtils
{
public :
MOCK_METHOD1(getSectorIds, vector<std::int32_t>(std::int32_t bcfId));
};
TEST(ResMap, constructor)
{
vector<std::int32_t> test_file;
MockimUtils ImUtils;
std::vector<std::int32_t> sectList;
ResMap ResMapObj;
EXPECT_CALL(ImUtils, getSectorIds(5))
.Times(AtLeast(1));
ResMapObj.getSectIdsFromBcfId(5);
}
o/p
Actual function call count doesn't match EXPECT_CALL(ImUtils, getSectorIds(5))...
Expected: to be called at least once
Actual: never called - unsatisfied and active
[ FAILED ] ResMap.constructor (0 ms)
[----------] 1 test from ResMap (0 ms total)