IncompleteJsonExceptionTest.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2021-05-01
  6. * Changed: 2021-05-01
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std.hpp>
  11. #include <ls_std_test.hpp>
  12. namespace
  13. {
  14. class IncompleteJsonExceptionTest : public ::testing::Test
  15. {
  16. protected:
  17. IncompleteJsonExceptionTest() = default;
  18. ~IncompleteJsonExceptionTest() override = default;
  19. void SetUp() override
  20. {}
  21. void TearDown() override
  22. {}
  23. };
  24. TEST_F(IncompleteJsonExceptionTest, constructor)
  25. {
  26. EXPECT_THROW({
  27. try
  28. {
  29. throw ls_std::IncompleteJsonException{};
  30. }
  31. catch (const ls_std::IncompleteJsonException &_exception)
  32. {
  33. EXPECT_STREQ("IncompleteJsonException thrown - this JSON string is incomplete.", _exception.what());
  34. throw;
  35. }
  36. }, ls_std::IncompleteJsonException);
  37. }
  38. }