| 73 | } |
| 74 | |
| 75 | TEST_F(SensorTest, on) |
| 76 | { |
| 77 | EXPECT_FALSE(getSensor().hasOn()); |
| 78 | state["config"]["on"] = true; |
| 79 | EXPECT_TRUE(getSensor().hasOn()); |
| 80 | EXPECT_TRUE(getSensor().isOn()); |
| 81 | |
| 82 | EXPECT_CALL(*handler, |
| 83 | PUTJson("/api/" + getBridgeUsername() + "/sensors/1/config", nlohmann::json({{"on", false}}), getBridgeIp(), |
| 84 | getBridgePort())) |
| 85 | .WillOnce(Return(nlohmann::json {{{"success", {{"/sensors/1/config/on", false}}}}})); |
| 86 | getSensor().setOn(false); |
| 87 | } |
| 88 | |
| 89 | TEST_F(SensorTest, BatteryState) |
| 90 | { |
nothing calls this directly
no test coverage detected