Added StaticJsonDocument and DynamicJsonDocument.

Removed StaticJsonArray and DynamicJsonArray.
Removed StaticJsonObject and DynamicJsonObject.
Removed StaticJsonVariant and DynamicJsonVariant.
This commit is contained in:
Benoit Blanchon
2018-04-17 21:27:45 +02:00
parent a13b9e8bdc
commit 1feb92679d
100 changed files with 1696 additions and 1844 deletions

View File

@ -6,24 +6,25 @@
#include <catch.hpp>
TEST_CASE("JsonObject::containsKey()") {
DynamicJsonObject _object;
DynamicJsonDocument doc;
JsonObject& obj = doc.to<JsonObject>();
SECTION("ContainsKeyReturnsFalseForNonExistingKey") {
_object.set("hello", 42);
obj.set("hello", 42);
REQUIRE(false == _object.containsKey("world"));
REQUIRE(false == obj.containsKey("world"));
}
SECTION("ContainsKeyReturnsTrueForDefinedValue") {
_object.set("hello", 42);
obj.set("hello", 42);
REQUIRE(true == _object.containsKey("hello"));
REQUIRE(true == obj.containsKey("hello"));
}
SECTION("ContainsKeyReturnsFalseAfterRemove") {
_object.set("hello", 42);
_object.remove("hello");
obj.set("hello", 42);
obj.remove("hello");
REQUIRE(false == _object.containsKey("hello"));
REQUIRE(false == obj.containsKey("hello"));
}
}