test/test_api_conn_handler/api_connector_generate_payload.cpp
/**
 * Test json payload, without power, gas and solar data
 */
Test json payload, without power, gas and solar data
Test json payload without power gas and solar data
void api_connector_handler_generate_payload_no_power_gas_solar_success(void) {
  MockLocalStorage config;
  ApiConnector api_connector(config);
  char payload[PAYLOAD_BUFFER_SIZE];
  api_connector.generate_payload(nullptr, nullptr, payload);
  TEST_ASSERT_EQUAL_STRING(
      "{"
      "\"power\":null,\"gas\":null,\"solar\":null"
      "}",
      payload
  );
}
void api_connector_handler_generate_payload_no_power_gas_solar_success ( void ) { MockLocalStorage config ; ApiConnector api_connector ( config ) ; char payload [ PAYLOAD_BUFFER_SIZE ] ; api_connector . generate_payload ( nullptr , nullptr , payload ) ; TEST_ASSERT_EQUAL_STRING ( " " " \" \" \" \" \" \" " " " , payload ) ; }
Test json payload, without power, gas and solar data
Test json payload without power gas and solar data
// Given // When // Then