Browse Source

Added tests that adds a boolean to a hash table

Benoît Blanchon 11 years ago
parent
commit
93ddb9498e
2 changed files with 19 additions and 4 deletions
  1. 4 4
      JsonGeneratorTests/JsonArrayTests.cpp
  2. 15 0
      JsonGeneratorTests/JsonHashTableTests.cpp

+ 4 - 4
JsonGeneratorTests/JsonArrayTests.cpp

@@ -53,7 +53,7 @@ namespace JsonGeneratorTests
             jsonIs("[3.14]");
         }
 
-        TEST_METHOD(AddTwoNumbers)
+        TEST_METHOD(TwoNumbers)
         {
             addValue(3.14);
             addValue(2.72);
@@ -61,7 +61,7 @@ namespace JsonGeneratorTests
             jsonIs("[3.14,2.72]");
         }
 
-        TEST_METHOD(AddOneNumberOverCapacity)
+        TEST_METHOD(OneNumberOverCapacity)
         {
             addValue(3.14);
             addValue(2.72);
@@ -70,14 +70,14 @@ namespace JsonGeneratorTests
             jsonIs("[3.14,2.72]");
         }
 
-        TEST_METHOD(AddTrue)
+        TEST_METHOD(OneTrue)
         {
             addValue(true);
 
             jsonIs("[true]");
         }
 
-        TEST_METHOD(AddFalse)
+        TEST_METHOD(OneFalse)
         {
             addValue(false);
 

+ 15 - 0
JsonGeneratorTests/JsonHashTableTests.cpp

@@ -51,6 +51,21 @@ namespace JsonGeneratorTests
             jsonIs("{\"key\":null}");
         }
 
+        TEST_METHOD(OneTrue)
+        {
+            add("key", true);
+
+            jsonIs("{\"key\":true}");
+        }
+
+        TEST_METHOD(OneFalse)
+        {
+            add("key", false);
+
+            jsonIs("{\"key\":false}");
+        }
+
+
     private:
 
         template<typename T>