feat: add Test for sendValue
This commit is contained in:
@ -29,13 +29,21 @@ void TestConnectAPI() {
|
||||
TEST_ASSERT_EQUAL_MESSAGE(true, api->connect(), "Not Connected");
|
||||
}
|
||||
|
||||
// void TestConnectAPIFailed() {
|
||||
// API* api = new API("Carl", "toto", API_HOST);
|
||||
//FIXME: boucle inf when connection failed
|
||||
void TestConnectAPIFailed() {
|
||||
API* api = new API("Carl", "toto", API_HOST);
|
||||
|
||||
// Serial1.begin(MONITOR_SPEED);
|
||||
// api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||
// TEST_ASSERT_EQUAL_MESSAGE(false, api->connect(), "Connected");
|
||||
// }
|
||||
Serial1.begin(MONITOR_SPEED);
|
||||
api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||
TEST_ASSERT_EQUAL_MESSAGE(false, api->connect(), "Connected");
|
||||
}
|
||||
|
||||
//Testing SendValue function
|
||||
void TestSendValue() {
|
||||
API* api = new API(USER_NAME, USER_PASSWORD, API_HOST);
|
||||
|
||||
Serial1.begin(MONITOR_SPEED);
|
||||
api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||
TEST_ASSERT_EQUAL_MESSAGE(true, api->sendValue("30", "gdnuxl0wlgurtj3", "W", true), "Not Connected to server");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user