forked from bblanchon/ArduinoJson
Added JsonObject::containsKey()
This commit is contained in:
1 parent
b4b475d692
commit
d38131d495
3 files changed
+18
-1
No files matched your search
@@ -114,3 +114,17 @@ TEST_F(JsonObject_Container_Tests, CanStoreInnerObjects) {
|
||||
EXPECT_EQ(&innerObject1, &object["hello"].asObject());
|
||||
EXPECT_EQ(&innerObject2, &object["world"].asObject());
|
||||
}
|
||||
|
||||
TEST_F(JsonObject_Container_Tests, ContainsKeyReturnFalseForNonExistingKey) {
|
||||
EXPECT_FALSE(object.containsKey("hello"));
|
||||
}
|
||||
|
||||
TEST_F(JsonObject_Container_Tests, ContainsKeyReturnTrueForDefinedValue) {
|
||||
object.add("hello", 42);
|
||||
EXPECT_TRUE(object.containsKey("hello"));
|
||||
}
|
||||
|
||||
TEST_F(JsonObject_Container_Tests, ContainsKeyReturnFalseForUndefinedValue) {
|
||||
object.add("hello");
|
||||
EXPECT_FALSE(object.containsKey("hello"));
|
||||
}
|
||||
Reference in new issue
Block a user