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

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

No files matched your search

+16
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());
}
+1
View File
@@ -85,6 +85,7 @@
<ItemGroup>
<ClCompile Include="..\third-party\gtest-1.7.0\src\gtest-all.cc" />
<ClCompile Include="..\third-party\gtest-1.7.0\src\gtest_main.cc" />
<ClCompile Include="JsonObjectTests.cpp" />
<ClCompile Include="StaticJsonBufferTests.cpp" />
</ItemGroup>
<ItemGroup>
+3
View File
@@ -27,5 +27,8 @@
<ClCompile Include="StaticJsonBufferTests.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="JsonObjectTests.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>