Added a test of an empty hashtable

This commit is contained in:
Benoît Blanchon
2014-06-27 13:00:27 +02:00
parent 48a91a219c
commit ebb257df6e
5 changed files with 94 additions and 16 deletions

View File

@ -0,0 +1,30 @@
#include "CppUnitTest.h"
#include "JsonHashTable.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace JsonGeneratorTests
{
TEST_CLASS(JsonHashTableTests)
{
JsonHashTable<2> hash;
public:
TEST_METHOD(Empty)
{
assertJsonIs("{}");
}
private:
void assertJsonIs(const char* expected)
{
char buffer[256];
hash.writeTo(buffer, sizeof(buffer));
Assert::AreEqual(expected, buffer);
}
};
}