Explorar o código

Improve KvPair class test coverage

- add missing test cases
Patrick-Christopher Mattulat %!s(int64=2) %!d(string=hai) anos
pai
achega
c7fe980a21
Modificáronse 1 ficheiros con 16 adicións e 1 borrados
  1. 16 1
      test/cases/io/kv/KvPairTest.cpp

+ 16 - 1
test/cases/io/kv/KvPairTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2021-05-02
+ * Changed:         2021-07-15
  *
  * */
 
@@ -17,6 +17,7 @@ namespace
     protected:
 
       KvPairTest() = default;
+
       ~KvPairTest() override = default;
 
       void SetUp() override
@@ -26,6 +27,20 @@ namespace
       {}
   };
 
+  TEST_F(KvPairTest, constructor_with_empty_key)
+  {
+    EXPECT_THROW({
+                   try
+                   {
+                     ls_std::KvPair pair = ls_std::KvPair("", "1989");
+                   }
+                   catch (const ls_std::IllegalArgumentException &_exception)
+                   {
+                     throw;
+                   }
+                 }, ls_std::IllegalArgumentException);
+  }
+
   TEST_F(KvPairTest, getKey)
   {
     ls_std::KvPair pair{"port", "13088"};