SocketOperationFailedExceptionTest.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2022-12-12
  6. * Changed: 2022-12-12
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std_core.hpp>
  11. using namespace ls::std::core;
  12. namespace
  13. {
  14. class SocketOperationFailedExceptionTest : public ::testing::Test
  15. {
  16. protected:
  17. SocketOperationFailedExceptionTest() = default;
  18. ~SocketOperationFailedExceptionTest() override = default;
  19. void SetUp() override
  20. {}
  21. void TearDown() override
  22. {}
  23. };
  24. TEST_F(SocketOperationFailedExceptionTest, constructor)
  25. {
  26. EXPECT_THROW({
  27. try
  28. {
  29. throw SocketOperationFailedException{};
  30. }
  31. catch (const SocketOperationFailedException &_exception)
  32. {
  33. EXPECT_STREQ("SocketOperationFailedException thrown - operation on socket was not successful!", _exception.what());
  34. throw;
  35. }
  36. }, SocketOperationFailedException);
  37. }
  38. }