forked from bblanchon/ArduinoJson
Test that JsonObject.size() is increased when values are added
This commit is contained in:
16
tests/JsonObjectTests.cpp
Normal file
16
tests/JsonObjectTests.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <StaticJsonBuffer.h>
|
||||
#include <JsonValue.h>
|
||||
|
||||
TEST(JsonObjectTests, WhenValueIsAdded_ThenSizeIsIncreasedByOne)
|
||||
{
|
||||
StaticJsonBuffer<42> json;
|
||||
|
||||
JsonObject object = json.createObject();
|
||||
|
||||
object["hello"];
|
||||
EXPECT_EQ(1, object.size());
|
||||
|
||||
object["world"];
|
||||
EXPECT_EQ(2, object.size());
|
||||
}
|
Reference in New Issue
Block a user