ClassTest.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-16
  6. * Changed: 2023-02-05
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls-std-core-test.hpp>
  11. #include <ls-std/ls-std-core.hpp>
  12. using namespace ls::std::core;
  13. using namespace ::std;
  14. using namespace test::core;
  15. namespace
  16. {
  17. class ClassTest : public ::testing::Test
  18. {
  19. protected:
  20. ClassTest() = default;
  21. ~ClassTest() override = default;
  22. void SetUp() override
  23. {}
  24. void TearDown() override
  25. {}
  26. };
  27. TEST_F(ClassTest, constructor_empty_parameter)
  28. {
  29. EXPECT_THROW(
  30. {
  31. try
  32. {
  33. Class object{""};
  34. }
  35. catch (const IllegalArgumentException &_exception)
  36. {
  37. throw;
  38. }
  39. },
  40. IllegalArgumentException);
  41. }
  42. TEST_F(ClassTest, destructor)
  43. {
  44. shared_ptr<ClassWrapper> object = make_shared<ClassWrapper>();
  45. EXPECT_CALL(*object, Die());
  46. }
  47. TEST_F(ClassTest, getClassName)
  48. {
  49. Class object{"Class"};
  50. ASSERT_STREQ("Class", object.getClassName().c_str());
  51. }
  52. }