i started unit-test with gtest and gmock. I want to test the content of an EXPECT_CALL in one line. How to do it the right way?
My example code:
class MockClientSignalEventHandler : public ISignalFunctionFeatureEventHandler<Data, Id> { public: MockClientSignalEventHandler() = default; MOCK_METHOD(void, onSignalEvent, (const std::shared_ptr<Id> &id, const std::shared_ptr<Data> &data), (override)); }; Now i want to check it in EXPECT_CALL. How can i check shared_ptr in EXPECT_CALL?
The code now looks like this:
EXPECT_CALL(*mockEventHandler, onSignal(::testing::_, ::testing::_)).WillOnce(ReturnFromDetached(&cv)); feature->handleFeatureMessage(messageHeader, data); std::mutex mx; std::unique_lock<std::mutex> lock(mx); cv.wait_for(lock, std::chrono::seconds(5)); Instead of ::testing::_ i want to check the content of shared_ptr.
Thanky you for your help!