1 #include "sensors/manager.hpp" 2 3 #include <gmock/gmock.h> 4 #include <gtest/gtest.h> 5 #include <sdbusplus/test/sdbus_mock.hpp> 6 7 using ::testing::_; 8 using ::testing::IsNull; 9 using ::testing::Return; 10 using ::testing::StrEq; 11 12 TEST(SensorManagerTest, BoringConstructorTest) { 13 // Build a boring SensorManager. 14 15 sdbusplus::SdBusMock sdbus_mock_passive, sdbus_mock_host; 16 auto bus_mock_passive = sdbusplus::get_mocked_new(&sdbus_mock_passive); 17 auto bus_mock_host = sdbusplus::get_mocked_new(&sdbus_mock_host); 18 19 EXPECT_CALL(sdbus_mock_host, 20 sd_bus_add_object_manager( 21 IsNull(), 22 _, 23 StrEq("/xyz/openbmc_project/extsensors"))) 24 .WillOnce(Return(0)); 25 26 SensorManager s(std::move(bus_mock_passive), std::move(bus_mock_host)); 27 // Success 28 } 29