MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / TEST

Function TEST

dependencies/hueplusplus-1.0.0/test/test_BridgeConfig.cpp:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31using namespace testing;
32
33TEST(BridgeConfig, refresh)
34{
35 auto handler = std::make_shared<MockHttpHandler>();
36 HueCommandAPI commands(getBridgeIp(), getBridgePort(), getBridgeUsername(), handler);
37 auto baseCache = std::make_shared<APICache>("", commands, std::chrono::steady_clock::duration::max(), nullptr);
38 EXPECT_CALL(
39 *handler, GETJson("/api/" + getBridgeUsername(), nlohmann::json::object(), getBridgeIp(), getBridgePort()))
40 .WillOnce(Return(nlohmann::json::object()));
41 baseCache->refresh();
42 BridgeConfig config(baseCache, std::chrono::steady_clock::duration::max());
43
44 EXPECT_CALL(*handler,
45 GETJson("/api/" + getBridgeUsername() + "/config", nlohmann::json::object(), getBridgeIp(), getBridgePort()))
46 .WillOnce(Return(nlohmann::json::object()));
47 config.refresh(true);
48}
49
50TEST(BridgeConfig, getWhitelistedUsers)
51{

Callers

nothing calls this directly

Calls 14

getBridgeIpFunction · 0.85
getBridgePortFunction · 0.85
getBridgeUsernameFunction · 0.85
getBridgeMacFunction · 0.85
getWhitelistedUsersMethod · 0.80
removeUserMethod · 0.80
getLinkButtonMethod · 0.80
pressLinkButtonMethod · 0.80
touchLinkMethod · 0.80
getMACAddressMethod · 0.80
getBaseTimeMethod · 0.80
getUTCTimeMethod · 0.80

Tested by

no test coverage detected