ClassTest.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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-22
  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. using namespace ::testing;
  16. namespace
  17. {
  18. class ClassTest : public Test
  19. {
  20. protected:
  21. ClassTest() = default;
  22. ~ClassTest() override = default;
  23. void SetUp() override
  24. {}
  25. void TearDown() override
  26. {}
  27. };
  28. TEST_F(ClassTest, constructor_empty_parameter)
  29. {
  30. EXPECT_THROW(
  31. {
  32. try
  33. {
  34. Class object{""};
  35. }
  36. catch (const IllegalArgumentException &_exception)
  37. {
  38. throw;
  39. }
  40. },
  41. IllegalArgumentException);
  42. }
  43. TEST_F(ClassTest, destructor)
  44. {
  45. shared_ptr<ClassWrapper> object = make_shared<ClassWrapper>();
  46. EXPECT_CALL(*object, Die());
  47. }
  48. TEST_F(ClassTest, getClassName)
  49. {
  50. Class object{"Class"};
  51. ASSERT_STREQ("Class", object.getClassName().c_str());
  52. }
  53. }