JsonHashTableTests.cpp 571 B

123456789101112131415161718192021222324252627282930
  1. #include "CppUnitTest.h"
  2. #include "JsonHashTable.h"
  3. using namespace Microsoft::VisualStudio::CppUnitTestFramework;
  4. namespace JsonGeneratorTests
  5. {
  6. TEST_CLASS(JsonHashTableTests)
  7. {
  8. JsonHashTable<2> hash;
  9. public:
  10. TEST_METHOD(Empty)
  11. {
  12. assertJsonIs("{}");
  13. }
  14. private:
  15. void assertJsonIs(const char* expected)
  16. {
  17. char buffer[256];
  18. hash.writeTo(buffer, sizeof(buffer));
  19. Assert::AreEqual(expected, buffer);
  20. }
  21. };
  22. }