Added a test that adds a string value in a hash

This commit is contained in:
Benoît Blanchon
2014-06-27 13:07:38 +02:00
parent ebb257df6e
commit ff4060f5d1
2 changed files with 44 additions and 5 deletions

View File

@ -16,8 +16,20 @@ namespace JsonGeneratorTests
assertJsonIs("{}");
}
TEST_METHOD(OneString)
{
add("key", "value");
assertJsonIs("{\"key\":\"value\"}");
}
private:
template<typename T>
void add(const char* key, T value)
{
hash.add(key, value);
}
void assertJsonIs(const char* expected)
{
char buffer[256];