Test that JsonObject.size() is increased when values are added

This commit is contained in:
Benoit Blanchon
2014-09-27 11:53:26 +02:00
parent 91649df593
commit 4d4119e589
8 changed files with 134 additions and 28 deletions

16
tests/JsonObjectTests.cpp Normal file
View 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());
}