Test that integers can be stored in a JsonObject

This commit is contained in:
Benoit Blanchon
2014-09-27 14:51:50 +02:00
parent a2fc188526
commit 71fd2de675
7 changed files with 63 additions and 18 deletions

View File

@ -26,4 +26,17 @@ TEST(JsonObjectTests, WhenTheSameValueIsAddedTwice_ThenSizeIsOnlyIncreasedByOne)
object["hello"];
EXPECT_EQ(1, object.size());
}
TEST(JsonObjectTests, WhenAnIntegerIsStore_TheSameIntegerIsRetreived)
{
StaticJsonBuffer<42> json;
JsonObject object = json.createObject();
object["hello"] = 123;
object["world"] = 456;
EXPECT_EQ(123, (int) object["hello"]);
EXPECT_EQ(456, (int) object["world"]);
}