Test that boolean values can be stored in a JsonObject

This commit is contained in:
Benoit Blanchon
2014-09-27 15:04:06 +02:00
parent 5fa446d3f5
commit 75588946c6
5 changed files with 36 additions and 27 deletions

View File

@ -52,4 +52,18 @@ TEST(JsonObjectTests, GivenAnDoubleStored_WhenRetreivingTheValue_ThenTheValueIsT
EXPECT_EQ(123.45, (double) object["hello"]);
EXPECT_EQ(456.78, (double) object["world"]);
}
TEST(JsonObjectTests, GivenABooleanStored_WhenRetreivingTheValue_ThenTheValueIsTheSame)
{
StaticJsonBuffer<42> json;
JsonObject object = json.createObject();
object["hello"] = true;
object["world"] = false;
EXPECT_TRUE((bool) object["hello"]);
EXPECT_FALSE((bool) object["world"]);
}