ClassTest.cpp 1.2 KB

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