ClassTest.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-16
  6. * Changed: 2022-11-09
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std_core.hpp>
  11. #include <ls_std_core_test.hpp>
  12. using namespace ls::std::core;
  13. using namespace ::std;
  14. using namespace ls_std_core_test;
  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. try
  31. {
  32. Class object{""};
  33. }
  34. catch (const IllegalArgumentException &_exception)
  35. {
  36. throw;
  37. }
  38. }, IllegalArgumentException);
  39. }
  40. TEST_F(ClassTest, destructor)
  41. {
  42. shared_ptr<ClassWrapper> object = make_shared<ClassWrapper>();
  43. EXPECT_CALL(*object, Die());
  44. }
  45. TEST_F(ClassTest, getClassName)
  46. {
  47. Class object{"Class"};
  48. ASSERT_STREQ("Class", object.getClassName().c_str());
  49. }
  50. }